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

Selection highlighting smudges canvas while animating #7216

Closed
vpanichkin opened this issue Jul 16, 2021 · 8 comments
Closed

Selection highlighting smudges canvas while animating #7216

vpanichkin opened this issue Jul 16, 2021 · 8 comments
Assignees
Labels
stale Issue marked as stale by the stale bot

Comments

@vpanichkin
Copy link

vpanichkin commented Jul 16, 2021

Version

4.5.1

Test Case

http://jsfiddle.net/m0jpr3Ld/

Information about environment

Chrome 91.0.4472.114

Steps to reproduce

  1. Double click on the word "text" to select it
  2. If the word it selected, the text will move to the top

Expected Behavior

Selection highlighting does not smudge the canvas
image

Actual Behavior

Selection highlighting is drawn "a path" while animation
image

P.S. Same happens with a cursor
image

@asturur asturur self-assigned this Jul 21, 2021
@avra-m3
Copy link
Contributor

avra-m3 commented Jul 31, 2021

Looks like the root cause is IText.clearContextTop only clears the area inside of the text box, a little bit of whatever is drawn gets left behind if the object moves before the next render cycle.

Would it be safe to clear the entire top context? Or would the preferred option be to store the last known coords of a selection/cursor during the render cycle and clear that area next time around.

I'd love to help out and this seems like a straightforward bug to dip my toes into, would love to hear what the preferred approach would be.

@asturur
Copy link
Member

asturur commented Aug 2, 2021

Yes, this was thought as an optimization.... because text isn't supposed to move while editing, and on large canvases, for some reason, this gets slow.
It does create issues tho, and we should probably remove this feature.

@asturur
Copy link
Member

asturur commented Aug 2, 2021

Alternatively is maybe possible to do a better sync of the request animation frame with the current object position

@avra-m3
Copy link
Contributor

avra-m3 commented Aug 7, 2021

I'll take a shot at option #2 and raise a pr when it's done. ☺️

@asturur
Copy link
Member

asturur commented Aug 8, 2021

yes please! if you have questions ask

@stale
Copy link

stale bot commented Aug 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Aug 22, 2021
@avra-m3
Copy link
Contributor

avra-m3 commented Aug 27, 2021

I've put some thought into it and would it be practical for animate to have a beforeChange event? This would allow us to clear context top before the transformation matrix changes.

Thanks @asturur, sorry for the delay getting back to this ☺️

@stale stale bot removed the stale Issue marked as stale by the stale bot label Aug 27, 2021
@stale
Copy link

stale bot commented Sep 10, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Sep 10, 2021
@stale stale bot closed this as completed Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue marked as stale by the stale bot
Projects
None yet
Development

No branches or pull requests

3 participants