Re-measure the character cell when the display scaling changes - #841
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.