Commit 91c49a2
committed
fix: improve DCI icon image positioning and layout
The layout method for DQuickDciIconImage has been completely rewritten
to fix positioning issues, particularly on high-DPI displays.
Previously, the image was simply centered using anchors, which could
cause misalignment. The new implementation calculates precise pixel-
aligned positions by considering device pixel ratios and scene
transformations. A timer-based scheduling mechanism was added to prevent
excessive layout recalculations. Additionally, smooth rendering is now
disabled by default during initialization to improve performance, and
geometry/parent change handlers ensure proper layout updates.
Log: Fixed DCI icon positioning issues on high-DPI displays
Influence:
1. Test DCI icon display on monitors with different DPI settings
2. Verify icon centering remains correct when parent item size changes
3. Test icon positioning when moving between windows or screens
4. Verify smooth property is properly initialized to false
5. Test layout updates when icon image dimensions change
6. Verify no performance regression from timer-based layout scheduling
fix: 修复 DCI 图标图像定位和布局问题
DQuickDciIconImage 的布局方法已完全重写,以修复定位问题,特别是在高 DPI
显示器上。之前,图像仅使用锚点居中,可能导致错位。新实现通过考虑设备像素
比和场景变换来计算精确的像素对齐位置。添加了基于定时器的调度机制以防止过
多的布局重新计算。此外,初始化期间默认禁用平滑渲染以提高性能,几何/父项
变更处理程序确保正确的布局更新。
Log: 修复高 DPI 显示器上的 DCI 图标定位问题
Influence:
1. 在不同 DPI 设置的显示器上测试 DCI 图标显示
2. 验证父项大小变化时图标居中保持正确
3. 测试在窗口或屏幕间移动时的图标定位
4. 验证 smooth 属性是否正确初始化为 false
5. 测试图标图像尺寸变化时的布局更新
6. 验证基于定时器的布局调度不会导致性能下降1 parent 7966d82 commit 91c49a2
3 files changed
Lines changed: 73 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
192 | | - | |
193 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
194 | 231 | | |
195 | 232 | | |
196 | 233 | | |
| |||
211 | 248 | | |
212 | 249 | | |
213 | 250 | | |
| 251 | + | |
| 252 | + | |
214 | 253 | | |
215 | 254 | | |
216 | 255 | | |
| |||
406 | 445 | | |
407 | 446 | | |
408 | 447 | | |
409 | | - | |
| 448 | + | |
410 | 449 | | |
411 | 450 | | |
412 | 451 | | |
| |||
417 | 456 | | |
418 | 457 | | |
419 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
420 | 481 | | |
421 | 482 | | |
422 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
0 commit comments