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 is not clearing children correctly on current master #3019

Closed
HendrikMennen opened this issue Sep 20, 2019 · 7 comments · Fixed by #3030
Closed

Canvas is not clearing children correctly on current master #3019

HendrikMennen opened this issue Sep 20, 2019 · 7 comments · Fixed by #3030
Labels

Comments

@HendrikMennen
Copy link

HendrikMennen commented Sep 20, 2019

The Canvas takes about 5-10 times longer on current master to update than it did before.
Ram usage is about the same.

It also appears to not remove it's children correctly anymore while calling canvas.children.Clear()

before

0.8.999-cibuild0004086-beta
2019-09-2019-06-15

after

0.8.999-cibuild0004126-beta
2019-09-2019-07-42

@MarchingCube
Copy link
Collaborator

Could you provide a small repro case?

@HendrikMennen
Copy link
Author

https://github.com/HendrikMennen/CanvasRepro
I know the performance difference is not really noticeable here. Could be because of using DispatcherTimer?

However it shows that there seems to be something wrong with Canvas.Children.Clear(), since the Canvas is not cleared anymore in the second picture

0.8.999-cibuild0004086-beta
2019-09-2115-01-08

0.8.999-cibuild0004126-beta
2019-09-2114-59-50

@ahopper
Copy link
Contributor

ahopper commented Sep 21, 2019

the dirty rects don't appear to be correctly updated on removing items.

@HendrikMennen HendrikMennen changed the title Canvas is much slower on current master Canvas is not clearing children correctly on current master Sep 21, 2019
@ahopper
Copy link
Contributor

ahopper commented Sep 22, 2019

removing this line

makes it work (not the solution but a pointer maybe) @grokys

@grokys grokys added the bug label Sep 22, 2019
@grokys
Copy link
Member

grokys commented Sep 22, 2019

Thanks @ahopper - looks like this was introduced by #3004 then. Will look into it.

@ahopper
Copy link
Contributor

ahopper commented Sep 22, 2019

In debugging this the Bounds of the Lines in the repro seemed to have zero height by the time they were added to the dirty rects.

@Gillibald
Copy link
Contributor

Gillibald commented Sep 22, 2019

When you clear a control's children should that invalidate the region that is covered by the control?

BTW it is not wise to clear a control's children just to add most of its previous children again. Better try work with existing items (object pooling).

grokys added a commit that referenced this issue Sep 23, 2019
grokys added a commit that referenced this issue Sep 23, 2019
This reverts commit db8751d.

The change was incorrect, it causes #3019.
grokys added a commit that referenced this issue Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants