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

Canvas doesn't render in MAUI app on initial load #103

Closed
taublast opened this issue Oct 29, 2024 Discussed in #98 · 3 comments
Closed

Canvas doesn't render in MAUI app on initial load #103

taublast opened this issue Oct 29, 2024 Discussed in #98 · 3 comments

Comments

@taublast
Copy link
Owner

taublast commented Oct 29, 2024

Discussed in #98

<views:Canvas Gestures="Enabled" HeightRequest="60" x:Name="Canvas" Grid.Row="1">
            <controls:ColorSlider HeightRequest="50" SelectedColor="{Binding SliderColor, Mode=OneWayToSource}"/>
</views:Canvas>

Originally posted by @nathenxbrewer October 24, 2024

I'm trying to consume a SkiaSlider using the Canvas. For some reason, when the app loads, the Canvas is not rendered. If I change the xaml in any way, the app will Hot Reload and the canvas is then rendered.

So here we have a situation that both Canvas and container layout inside have auto-size. The issue is that after measurement the measured layout size is not taken into consideration by the Canvas to adapt to measured content size.

To be fixed.

@taublast taublast self-assigned this Oct 29, 2024
@taublast
Copy link
Owner Author

@nathenxbrewer can you please share your xaml regarding the Grid? I see you have Grid.Row="1" so..
Or maybe you slider is different from the Sandbox one?

i tried to repro with the following, but no luck, canvas shows okay:

    <!--tried without definitions, same..-->
    <Grid RowDefinitions="80,*">


        <draw:Canvas
            x:Name="Canvas"
            Grid.Row="1"
            Gestures="Enabled"
            HeightRequest="60">
            <!--  one from the Sandbox project  -->
            <controls:SliderColor HeightRequest="50" />
        </draw:Canvas>

    </Grid>

@taublast
Copy link
Owner Author

taublast commented Nov 5, 2024

i have a feeling this might fix it, to be verified when repro is available: #c6687bdffb21b2949d2fc8b633aee311ba9d3222

@taublast
Copy link
Owner Author

taublast commented Dec 6, 2024

Since we have no feedback would assume it was fixed, feel free to re-open if I was wrong.

@taublast taublast closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant