[Win32] Ensure that default spaces inside controls are large enough #2775
+28
−24
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.
When computing the sizes for buttons, table and tree items, some magic values for spaces defined as point values are used. As the size computation is done in pixels, they are converted to pixel values. As they need to be rounded, they may become too small when converted to pixels.
This change adapts according places to always round such values up, so that spaces are large enough. That conforms to what we already did for actual computeSize() methods to ensure that sufficient space is provided for controls.
Note that for the table implementation, the change is effectively a no-op right now, as the INSET value of
4will be an integer value for every fractional "quarter" zoom, so that the used rounding method is irrelevant. It is just adapted for the sake of consistency and to be prepared for the case that this value may be changed at some point in the future.This also reverts the following change which accidentally used point values in a pixel context:
Before
At 175% zoom:

After
At 175% zoom:
