Opened 21 months ago
Closed 8 weeks ago
#18288 closed bug (fixed)
Text not vertically aligned in CalendarView
Reported by: | accessays | Owned by: | stippi |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta6 |
Component: | User Interface | Version: | R1/beta4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Days in the calendar widget (seen by clicking on time in Deskbar) are not vertically aligned. This can be easily seen if a day is selected (see attached image). Same goes for date selection in "Date and time", where system datetime is modified.
Attachments (3)
Change History (5)
by , 21 months ago
Attachment: | d6f5bc931fe48c9f702a0d6c2b89fdd02bff9d41.png added |
---|
comment:1 by , 21 months ago
by , 21 months ago
Attachment: | Screenshot_20230302_000323.png added |
---|
Looks a lot better on the first row
by , 21 months ago
Attachment: | Screenshot_20230301_235738.png added |
---|
But still offset on the bottom row
comment:2 by , 8 weeks ago
Milestone: | Unscheduled → R1/beta6 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in hrev58189.
Note:
See TracTickets
for help on using tickets.
This is due to incorrect centering calculations in CalendarView. Now it is done as follows:
where FontHeight(owner) is ascent + descent + leading, and - 2.0 accounts for the extra padding (4.0) within the cell, I assume.
The correct calculation is as follows:
This centers the text like you would center a bitmap (top + (bounds.height - bitmap.height)/2) and accounts for the fact that font rendering is done from the baseline (+ fheight.ascent).
This makes the result better, but does not fully fix the issue. The numbers in the cells start drifting the lower down they are. I'm guessing that's because cell borders are not taken into account, but I haven't looked at that yet.