-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird 1 pixel layout bug when a control is loaded. Repro and video included. #12676
Comments
👀 can reproduce on my machine. Great and easy sample 👍 |
Thanks for looking, I have no idea why that happen, but I hope it can be fixed :) |
place your sample into samples > Sandbox and add breakpoints into the layout pass if you want to investigate it on your own further. |
Could be related to rounding differences. First layout snaps the control to the left. Second to the right. Just some theory. |
I had a look at this: please see #12765 for details about the problem and a potential fix. |
Describe the bug
There is a layout issue when a control is loaded and before it is touched. It is 1 pixel too long in width. After its state change, the control with is reduce by 1 pixel.
This is related to ContentDialog foreground change.
To Reproduce
To better see the result, put the button inside a LayoutTransformControl with x8 scaling, and set padding to 0
When you run the app, there is 2 pixels between text and border on left side, and 1 pixel on right side.
When you mouseover (in fact, when the state of the foreground change), the left side become 1 px.
If you create a custom theme for the button, with BrushA for Foreground, BrushA again for MouseOver, and BrushB for Pressed.
The 1-pixel shift only happen when the button is pressed, that allow to measure with the inspector, and we can see that the DesiredSize of the text is reduced by 1 pixel after the foreground state change.
Expected behavior
The layout must be good when the control is loaded, and should not change after.
Screenshots
1pixel_bug.mp4
Repro sample
OnePixelBug.zip
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: