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

Configurable rotate cursor on transformer #1597

Merged

Conversation

iloabn
Copy link
Contributor

@iloabn iloabn commented Jul 6, 2023

Add tests for and ability to change rotate anchor cursor for transformer.
One test for verifying that the default cursor works, another for verifying that it works to change cursor.

Not really sure about the addition of the rotateCursor to the method getCursor.

Previously it looked like this:

function getCursor(anchorName, rad) {
if (anchorName === 'rotater') {
  return 'crosshair';
}

and now it looks like this

function getCursor(anchorName, rad, rotateCursor) {
if (anchorName === 'rotater') {
  return rotateCursor;
}
  • I'm unsure if there's a better way or if this is the way to go?
  • Also a little new to writing these types of canvas tests, used another test as a starting point and don't think there's any redundant code in there, but would love suggestions or pointers on how it could be improved.
  • Finally, should I add a rotateAnchorCursorChange to the ATTR_CHANGE_LIST as well?

Closes #1590

Add tests for and ability to change rotate anchor cursor for transformer
@lavrton lavrton merged commit edb7529 into konvajs:master Jul 17, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] Possibility to customize transformer rotate cursor
2 participants