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

Adorner drawing delay/lag #5878

Closed
RomanSoloweow opened this issue May 6, 2021 · 9 comments
Closed

Adorner drawing delay/lag #5878

RomanSoloweow opened this issue May 6, 2021 · 9 comments
Labels

Comments

@RomanSoloweow
Copy link
Contributor

When the element is moved, the Adorner has a draw lag.
The movement itself is implemented through TranslateTransform.

adornerkek

This bug is especially noticeable in this frame:
image

@RomanSoloweow
Copy link
Contributor Author

RomanSoloweow commented May 6, 2021

The bug is repeated if you implement movement through Canvas.Left and & Canvas.Top

@RomanSoloweow
Copy link
Contributor Author

This becomes a problem if you implement resizing control using the Adorner layout

@timothyparez
Copy link

I can confirm this as well.
You can also test this with the AvaloniaBehaviors repository if
you enable Adorners on this line

@grokys
Copy link
Member

grokys commented May 26, 2021

The problem here is that the adorner layer uses the TransformedBounds property to calculate the exact position (after transforms, ancestor transforms etc) of the adorner, but this property is only updated on render, meaning that the adorner is a frame behind.

It should be possible to calculate the position without TransformedBounds but that would require listening for changes to every property that could affect visual positioning of the whole tree leading up to the adorned control, which doesn't seem like a great idea for performance.

Another (probably better) alternative would be to special-case the adorner layer in the renderer and update it after all other controls have had their TransformedBounds set.

@RomanSoloweow
Copy link
Contributor Author

@grokys Are there any plans to work in this direction

@EtherGhost
Copy link

EtherGhost commented Jul 9, 2021

When can we count on this being fixed?

I have another adorner layer issue. Validation error are shown twice.

Skarmbild-fran-2021-07-06-22-31-56

Skarmbild-fran-2021-07-06-22-32-52

The second image shows how it looks after I put a letter in "Project name" TextBox and then remove it again. Then that TextBox is the only one that shows the error twice. I'm using the exact same code as for my WPF app so it shouldn't be a problem with my code.
Is this related?

@maxkatz6
Copy link
Member

maxkatz6 commented Jul 9, 2021

@kvalitetskontrollMarkaryd I don't see anything related to adorner layer in your problem.
Errors duplicating must be caused by actually multiple errors being set in view model and it depends on its implementation, you need to check it. WPF might distinct them though.
Although I don't see any problem in Avalonia, at least rn, you can create another issue to keep track on it.

@RomanSoloweow
Copy link
Contributor Author

Is there any work planned to fix the AdornerLayout?
If so, which version?

@EtherGhost
Copy link

@maxkatz6 Are you sure?
I made a small sample project, have a look!

https://github.com/kvalitetskontrollMarkaryd/Avalonia.ValidationTest.git

@kekekeks kekekeks closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants