Repository navigation
Conversation
1. Root cause: QPainter::drawText with a rect argument clips text exceeding the rectangle by default, while the QML preview uses CanvasContext.fillText which never clips — the mismatch causes text annotations to be truncated in saved images 2. Fix: add Qt::TextSingleLine | Qt::TextDontClip flags to the text annotation drawText call, and Qt::TextDontClip to the number annotation drawText call, matching the non-clipping QML preview 3. Impact: text and number annotations in saved images render identically to the edit preview, no effect on other annotation types Log: Fix text annotation truncation when saving edited images Influence: 1. Test adding long text annotations and saving, verify text is complete 2. Test adding number annotations and saving, verify number is complete 3. Verify saved image matches the edit preview for text annotations fix: 修复看图编辑文本标注保存后截断问题 1. 根因:保存时 QPainter::drawText 传入矩形参数默认裁剪超出边界的 文本,而 QML 预览使用 CanvasContext.fillText 不裁剪,两者不一致 导致保存的图片中文本标注被截断 2. 方案:在文本标注 drawText 调用中添加 Qt::TextSingleLine | Qt::TextDontClip 标志,在序号标注 drawText 调用中添加 Qt::TextDontClip 标志,使保存渲染与 QML 预览一致 3. 影响:保存图片中的文本和序号标注渲染与编辑预览一致,不影响其他 标注类型 Log: 修复看图编辑文本标注保存后截断的问题 Influence: 1. 测试添加长文本标注后保存,验证文本完整不被截断 2. 测试添加序号标注后保存,验证序号完整不被截断 3. 验证保存图片中文本标注与编辑预览一致 PMS: BUG-379123
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates image composition saving so text and number annotations are not clipped by QPainter, matching the edit preview while leaving other annotation types unchanged. Flow diagram for unclipped annotation image savingflowchart LR
A[Annotation data] --> B[ImageEditController.saveComposite]
B --> C{Annotation type}
C -->|Text| D[QPainter.drawText with TextSingleLine and TextDontClip]
C -->|Number| E[QPainter.drawText with TextDontClip]
D --> F[Saved image matches edit preview]
E --> F
C -->|Other| G[Existing rendering unchanged]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例本报告由 AI 代码审查工具自动生成 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: prevent text clipping in image annotation save
exceeding the rectangle by default, while the QML preview uses
CanvasContext.fillText which never clips — the mismatch causes
text annotations to be truncated in saved images
annotation drawText call, and Qt::TextDontClip to the number
annotation drawText call, matching the non-clipping QML preview
identically to the edit preview, no effect on other annotation types
Log: Fix text annotation truncation when saving edited images
Influence:
fix: 修复看图编辑文本标注保存后截断问题
文本,而 QML 预览使用 CanvasContext.fillText 不裁剪,两者不一致
导致保存的图片中文本标注被截断
Qt::TextDontClip 标志,在序号标注 drawText 调用中添加
Qt::TextDontClip 标志,使保存渲染与 QML 预览一致
标注类型
Log: 修复看图编辑文本标注保存后截断的问题
Influence:
PMS: BUG-379123
Summary by Sourcery
Bug Fixes: