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

Invalidate() does not invoke Draw() when GraphicsView is inside a Grid. #12560

Closed
Greg-Bates-Trimble opened this issue Jan 10, 2023 · 6 comments
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/android 🤖 s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Milestone

Comments

@Greg-Bates-Trimble
Copy link

Description

Cannot redraw a graphics view when the view is inside either a grid or stacklayout. E.g. calling Invalidate will not go and call Draw().

Steps to Reproduce

  1. Run the application in the public repo.
  2. On MainPage.xaml is the element to display it not working.
  3. Removing the grid and the Graphics view will begin to update.

Link to public reproduction project repository

https://github.com/Greg-Bates-Trimble/GraphicsView_Not_Redrawing/tree/main

Version with bug

6.0.312

Last version that worked well

6.0.312

Affected platforms

Android

Affected platform versions

Android 12 and up

Did you find any workaround?

Have not found a workaround as this is required for a page with lots of elements.

Have not tried on iOS

Relevant log output

No response

@Greg-Bates-Trimble Greg-Bates-Trimble added the t/bug Something isn't working label Jan 10, 2023
@Eilon Eilon added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Jan 10, 2023
@jsuarezruiz jsuarezruiz self-assigned this Jan 11, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jan 11, 2023
@ghost
Copy link

ghost commented Jan 11, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@jsuarezruiz jsuarezruiz removed their assignment Jan 11, 2023
@jsuarezruiz jsuarezruiz added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jan 11, 2023
@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Jan 11, 2023

Debugging the code seems to be an issue related with a layout sizing issue.

fix-graphicsview-issue

The Invalidate method use internally-calculated area based on the View height and width. The height is zero and for that reason the invalidated area is wrong. Works using the deprecated method invalidate(Rect) with a specific height (for example, 1000).

Added the Layout label to the issue.

@Greg-Bates-Trimble
Copy link
Author

Hi @jsuarezruiz thanks for that information. With those details have been able to construct a work around, which is to specify a HeightRequest and WidthRequest on the Graphics View.

@DoubleDBE
Copy link

@Greg-Bates-Trimble

Your work around doesn't seem to work for me.

Did you specify your WidthRequest and HeightRequest in XAML or where did you apply it?

@jinxinjuan jinxinjuan added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Jul 19, 2023
@ghost
Copy link

ghost commented Jul 19, 2023

Hi @Greg-Bates-Trimble. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jinxinjuan
Copy link

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 3.0(net8). Not repro on Android platform with sample project. GraphicsView_Not_Redrawing/tree/main

@ghost ghost closed this as completed Jul 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2023
This issue was closed.
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 area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/android 🤖 s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants