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

[ShadowContainer] Canvas can be set to a negative Height/Width, crashing on Windows #803

Closed
kazo0 opened this issue Sep 3, 2023 · 0 comments · Fixed by #804, #810 or #811
Closed

[ShadowContainer] Canvas can be set to a negative Height/Width, crashing on Windows #803

kazo0 opened this issue Sep 3, 2023 · 0 comments · Fixed by #804, #810 or #811
Assignees
Labels
control/shadows kind/bug Something isn't working

Comments

@kazo0
Copy link
Contributor

kazo0 commented Sep 3, 2023

Given the content of ShadowContainer that has a Margin whose Top+Bottom or Left+Right is greater than the content's Height or Width can result in a crash on Windows.

With this XAML:

<utu:ShadowContainer>
	<Border Height="50"
			Width="100"
			Background="Red"
			Margin="30" />
</utu:ShadowContainer>

The application will crash with a message of "Value does not fall within the expected range."

The culprit is this line where _canvas.Height will temporarily be given a negative value

@kazo0 kazo0 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. control/shadows and removed triage/untriaged Indicates an issue requires triaging or verification. labels Sep 3, 2023
@kazo0 kazo0 self-assigned this Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment