Skip to content
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

RelativePanel does not measure Correctly #794

Closed
danwalmsley opened this issue Apr 15, 2021 · 2 comments
Closed

RelativePanel does not measure Correctly #794

danwalmsley opened this issue Apr 15, 2021 · 2 comments

Comments

@danwalmsley
Copy link
Contributor

danwalmsley commented Apr 15, 2021

Describe the bug
A clear and concise description of what the bug is.

image

Top is UWP, bottom is WPF handycontrol version,

Since the recent fix we do not return the measured size or minimum size the content takes up.
This is because we are returning the maximum available size from MeasureOverride, regardless of Horizontal and VerticalAlignment.
To Reproduce

```
<handy:RelativePanel Background="Gray" HorizontalAlignment="Left" VerticalAlignment="Top">
    <Rectangle x:Name="RedRect" Fill="Red" Height="44" Width="44"/>
    <Rectangle x:Name="BlueRect" Fill="Blue"
           Height="44" Width="88"
           handy:RelativePanel.RightOf="RedRect" />

    <Rectangle x:Name="GreenRect" Fill="Green" 
           Height="44"
           handy:RelativePanel.Below="RedRect" 
           handy:RelativePanel.AlignLeftWith="RedRect" 
           handy:RelativePanel.AlignRightWith="BlueRect"/>
    <Rectangle Fill="Orange"
           handy:RelativePanel.Below="GreenRect" 
           handy:RelativePanel.AlignLeftWith="BlueRect" 
           handy:RelativePanel.AlignRightWithPanel="True"
           handy:RelativePanel.AlignBottomWithPanel="True"/>
</handy:RelativePanel>
```
@NaBian NaBian closed this as completed in 916d3d1 Apr 19, 2021
@NaBian
Copy link
Member

NaBian commented Apr 19, 2021

As shown, I think the UWP rendering is wrong(the left image is UWP, which has a gray background on the right)

<RelativePanel Background="Gray" HorizontalAlignment="Left" VerticalAlignment="Top">
    <Rectangle x:Name="RedRect" Fill="Red" Height="44" Width="44"/>
    <Rectangle x:Name="BlueRect" Fill="Blue"
               Height="44" Width="88"
               RelativePanel.RightOf="RedRect" />

    <Rectangle x:Name="GreenRect" Fill="Green" 
               Height="44"
               RelativePanel.Below="RedRect" 
               RelativePanel.AlignLeftWith="RedRect" 
               RelativePanel.AlignRightWith="BlueRect"/>
</RelativePanel>

demo

@danwalmsley
Copy link
Contributor Author

Awesome, I agree UWP is wrong, and the behavior is now as I expect. Thankyou for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants