calc: center minus/plus symbols and level numbers in group boxes#15177
calc: center minus/plus symbols and level numbers in group boxes#15177pedropintosilva merged 1 commit intomainfrom
Conversation
|
I love it, it looks much better! |
b2a4d8d to
f36f14c
Compare
Before the level numbers would also overflow the group boxes when the font is adjusted in the browser settings For example this was at browser font Very large (24px)
This PR addresses the above overflow issue by adjusting the positioning of the level numbers so they remain within the group boxes. The numbers are now positioned slightly above the vertical center, which provides better visual balance and avoids clipping at larger font sizes. Browser font size: Very large (24px) at zoom level 125%)
Browser font size: medium (9px) at zoom level 125%
Browser font size: Very small (9px) at zoom level 175%
cc @eszkadev |
| this.context.beginPath(); | ||
| this.context.fillStyle = this.backgroundColor; | ||
| this.context.fillRect(this.transformRectX(startX, this._groupHeadSize), startY, this._groupHeadSize, this._groupHeadSize); | ||
| this.context.strokeStyle = 'black'; |
f36f14c to
6dbb036
Compare
|
Thanks @banobepascal the dark mode is now fixed and the minus is now without artifacts
but the plus seems to still have half px up and half px down Edit the vertical stroke of the + uses bare startY + ... without the + 0.5 offset that the horizontal stroke has. Shouldn't it be: ? |
6dbb036 to
0bd908b
Compare
pedropintosilva
left a comment
There was a problem hiding this comment.
Needs another +1
- The plus/minus symbol and box drawing code was duplicated between ColumnGroup and RowGroup. Move it into a shared drawGroupBoxes method in GroupBase to eliminate the duplication. - The connector lines between group heads and tail markers used lineWidth 2.0, which looked thick relative to the 1px box strokes. Change them to lineWidth 1.0 and align coordinates to the pixel grid with +0.5 offsets so they render as crisp single-pixel lines. - The level number vertical position used a fixed 2*dpiScale offset that did not account for varying box sizes. Replace it with ctrlHeadSize/1.9 so the text sits closer to the true visual center of the box. - Fix canvas anti-aliasing (blurring) on outline group +/- icons Signed-off-by: Banobe Pascal <banobe.pascal@collabora.com> Change-Id: Id52679b46e397db7293617f532b213795c3e25e6
0bd908b to
6adde60
Compare
gokaysatir
left a comment
There was a problem hiding this comment.
New look is better. I think drawGroupBoxes is centralized and the other changes are visual. Looks good to me thank you.










Change-Id: I752f6a0a5eed762d83e680c2da1ab06b3fabde3c
Summary
The plus and minus symbols inside the row and column group boxes were not visually centered because their line endpoints were uneven. The drawing logic used 25% and 75% of the box size, but the end coordinate had an extra app.roundedDpiScale, which pushed the line too far on one side. Removing that extra offset makes the padding even on both sides and centers the symbols properly.
The level numbers in the header boxes also appeared slightly off vertically. Although the text is drawn with textBaseline = 'middle', the previous offset of + 2 * app.dpiScale pushed the numbers too far from the visual center. Reducing it to + app.dpiScale reuslting in better alignment without over adjusting.
PREVIEW