-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix: LEAP-2028: Fix brush cursor updating and visibility #7484
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
Conversation
Fix generating cursor image for brush. Unified cursor update logic across tools and regions by introducing a shared `updateCursor` method. Refactored brush and erase tools to use the `BrushCursorMixin` for consistent custom cursor generation. Simplified and removed redundant cursor management code from multiple regions and tools, improving maintainability.
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for heartex-docs canceled.
|
nass600
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor, pretty neat 👏 . My only comment is, if the cursor will be used at least in Brush and Erase maybe CursorMixin and having its own file could be more semantic but not sure if I might be missing some other context
I thought about its own file for that, but this mixin is too specific (only Brush tools pack), so I prefer to keep it coupled for now. |
|
/git merge
|
hlomzik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like the name of the method with this parameter, because then updateCursor(true) looks unclear. One of the ways to go could be to use named param: updateCursor({ hovered: true }).
But that's a very focused feature anyway, so I'm okay with current version.
Co-authored-by: Andrew <[email protected]>
Fix generating cursor image for brush.
Unified cursor updating logic across tools and regions by introducing a shared
updateCursormethod. Refactored brush and erase tools to use theBrushCursorMixinfor consistent custom cursor generation. Simplified and removed redundant cursor management code from multiple regions and tools, improving maintainability.Reason for change
The brush cursor was not updating correctly or consistently across tools and regions. The solution introduces a shared
updateCursormethod to unify and simplify cursor update logic. TheBrushCursorMixinis now leveraged for consistent custom cursor management, improving maintainability and removing redundant code.Image bigger that 128px can't be displayed as a cursor by most browsers.
Screenshots
Before
After
Testing
This change has been tested locally and manually:
Risks
No significant risks are identified. Changes simplify the cursor management logic without altering unrelated functionality.