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

Rendering is not visible before rebuilding the entire control #7639

Closed
PraveenGopalsamy opened this issue May 31, 2022 · 1 comment · Fixed by #8192
Closed

Rendering is not visible before rebuilding the entire control #7639

PraveenGopalsamy opened this issue May 31, 2022 · 1 comment · Fixed by #8192
Assignees
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing high It doesn't work at all, crashes or has a big impact. p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@PraveenGopalsamy
Copy link

PraveenGopalsamy commented May 31, 2022

Description

Hi, I'm trying to perform drawings based on the interaction. In windows, the Draw method gets invoked at load time but there is no rendering in the UI. This didn't get worked until rebuilding the entire application using the InvalidateMeasureOverride() method.

XAML

<ContentPage.Content>
       <local:SampleView />
 </ContentPage.Content>

C#

public class SampleView : GraphicsView
{
    public SampleView()
    {
        Drawable = new GraphicsDrawable();
    }

    protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
    {
        return new Size(widthConstraint, heightConstraint);
    }
}

public class GraphicsDrawable : IDrawable
{
    public void Draw(ICanvas canvas, RectF dirtyRect)
    {
        // Draw something here.
        canvas.FillColor = Colors.Yellow;
        canvas.FillRectangle(dirtyRect);
        canvas.DrawRectangle(dirtyRect);
        canvas.DrawString("Welcome to MAUI !!!", 10, 50, HorizontalAlignment.Left);
    }
}

Steps to Reproduce

  1. Create a new Maui App.
  2. Create a new class, which extends the class from GraphicsView.
  3. Create a new class that implements IDrawable, and assign this Drawable to GraphicsView.
  4. Now draw a simple text or rectangle using the passed dirtyRect.
  5. Here at load time or any interaction didn't get rendered. Once we have invoked the InvalidateMeasureOverride() method, the rendering gets visible.

Demo: Windows rendering issue demo

Version with bug

6.0 (current)

Last version that worked well

Release Candidate 2

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.17134.0

Did you find any workaround?

Not Applicable.

Relevant log output

No response

@PraveenGopalsamy PraveenGopalsamy added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels May 31, 2022
@PraveenGopalsamy PraveenGopalsamy changed the title Rendering is not visible before calling Invalidate Rendering is not visible before rebuilding the entire control May 31, 2022
@Eilon Eilon added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label May 31, 2022
@kristinx0211 kristinx0211 added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jun 1, 2022
@kristinx0211
Copy link

repro on windows with 17.3.0 Preview 2.0 [32531.271.main]. repro project:
MauiApp5.zip

@jsuarezruiz jsuarezruiz added platform/windows 🪟 high It doesn't work at all, crashes or has a big impact. labels Jun 21, 2022
@jsuarezruiz jsuarezruiz self-assigned this Jun 21, 2022
@jsuarezruiz jsuarezruiz added this to the 6.0-sr2 milestone Jun 21, 2022
@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Jul 7, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing high It doesn't work at all, crashes or has a big impact. p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants