Skip to content

Re-measure the character cell when the display scaling changes - #841

Merged
SimonCropp merged 1 commit into
mainfrom
fix-canvas-dpi
Aug 23, 2026
Merged

Re-measure the character cell when the display scaling changes#841
SimonCropp merged 1 commit into
mainfrom
fix-canvas-dpi

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

The canvas lays everything out in character cells and measures one, in pixels, from
a Graphics - which is per display. The measurement was kept for the life of the
control and only the footer and the scrollbar were rescaled on a DPI change, so
dragging the window to a display at 150% left the framework drawing the same eleven
point glyphs half again as large on the old row pitch and gutter: rows overlapping,
labels clipped, and a body row count that did not describe what was on screen. The
other way round left gaps.

The measurement is thrown away on OnDpiChangedAfterParent, and a dragged splitter is
now remembered in cells rather than pixels, which is what the constant beside it
always said it was for: the column holds the same number of characters on the new
display rather than the same number of pixels.

No test. Observing it takes a second display at a different scale factor, which
nothing in the suite can produce; the pixel snapshots cover the arithmetic at one
scale.

The canvas lays everything out in character cells and measures one, in pixels, from
a Graphics - which is per display. The measurement was kept for the life of the
control and only the footer and the scrollbar were rescaled on a DPI change, so
dragging the window to a display at 150% left the framework drawing the same eleven
point glyphs half again as large on the old row pitch and gutter: rows overlapping,
labels clipped, and a body row count that did not describe what was on screen. The
other way round left gaps.

The measurement is thrown away on OnDpiChangedAfterParent, and a dragged splitter is
now remembered in cells rather than pixels, which is what the constant beside it
always said it was for: the column holds the same number of characters on the new
display rather than the same number of pixels.

No test. Observing it takes a second display at a different scale factor, which
nothing in the suite can produce; the pixel snapshots cover the arithmetic at one
scale.
@SimonCropp
SimonCropp merged commit d68cc9c into main Aug 23, 2026
9 checks passed
@SimonCropp
SimonCropp deleted the fix-canvas-dpi branch August 23, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant