Commit 270248f
committed
fix: prevent negative margins in dock center alignment
Fixed dock layout calculation to prevent negative margins when centering
dock items. Changed Layout.leftMargin and Layout.topMargin calculations
to use Math.max(0, ...) to ensure margins are never negative. This
prevents layout issues when dock items are larger than available space.
The issue occurred when the dock center part's implicit width/height
was larger than the available dock space, causing negative margins that
could break the layout. The fix ensures margins are clamped to zero
minimum, maintaining proper visual alignment even in constrained space
conditions.
Influence:
1. Test dock with various item counts and sizes to verify centering
works correctly
2. Verify dock layout when items exceed available space
3. Test both horizontal and vertical dock orientations
4. Check that dragging and resizing behaviors remain smooth
5. Validate center alignment with different panel sizes
fix: 修复任务栏居中布局负边距问题
修复了任务栏居中布局计算,防止在居中任务栏项目时出现负边距。将
Layout.leftMargin和Layout.topMargin计算改为使用Math.max(0, ...),确保边
距永远不会为负值。这解决了当任务栏项目大于可用空间时的布局问题。
问题发生在任务栏中心部分的隐式宽度/高度大于可用任务栏空间时,导致负边距
可能破坏布局。修复确保边距被限制在最小零值,即使在空间受限的情况下也能保
持正确的视觉对齐。
Influence:
1. 测试不同项目数量和大小下任务栏的居中功能
2. 验证项目超过可用空间时的任务栏布局
3. 测试水平和垂直两种任务栏方向
4. 检查拖拽和调整大小行为是否保持流畅
5. 验证不同面板大小下的居中对齐效果
PMS: BUG-3518051 parent 87b7184 commit 270248f
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
519 | | - | |
| 519 | + | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| |||
0 commit comments