Fix image cropping on Windows - #1144
Merged
alexmontesg merged 2 commits intoAug 5, 2026
Merged
Conversation
alexmontesg
force-pushed
the
fix/1138-crop-cursor-windows
branch
from
August 5, 2026 10:17
ab4eb46 to
65c3846
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a Windows-specific UX bug in the SDK image crop mode where the resize/crop cursor (and thus crop interaction) could fail to appear when Ctrl is held and crop anchors are created under an already-positioned pointer. The change ensures crop anchors are synchronously drawn and the cursor is updated immediately based on the current pointer location, aligning behavior with issue #1138.
Changes:
- Force a synchronous
utilityLayer.draw()when entering crop mode viaCtrl/Cmd, ensuring the hit graph includes the newly rendered crop anchors immediately. - Add logic to re-evaluate the current pointer position on
Ctrl/Cmdpress and set the correct resize cursor if the pointer is already over a crop anchor. - Add/extend Vitest coverage for synchronous drawing and cursor update behavior; update changelogs to include the fix.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/content/docs/main/changelog/5.x/5.2.1.mdx | Documents the #1138 fix in the 5.2.1 changelog. |
| code/packages/sdk/src/nodes/image/image.ts | Ensures crop-mode utility layer is drawn synchronously and updates cursor based on current pointer intersection with anchors. |
| code/packages/sdk/src/nodes/image/tests/image.test.ts | Adds tests for synchronous draw order and cursor update when pointer is already over a crop anchor. |
| code/CHANGELOG.md | Adds #1138 entry to the main code changelog. |
jesusmpc
approved these changes
Aug 5, 2026
jesusmpc
approved these changes
Aug 5, 2026
alexmontesg
added a commit
that referenced
this pull request
Aug 6, 2026
…#1139) * fix(nodes-selection): scope back-shape re-target to transformer back node Konva's Transformer parents both the drag-whole-selection overdraw shape and the resize anchors/rotater. The re-target-on- pointerdown logic (meant only for , to let a node underneath the selection's bounding box be dragged instead) also fired for anchor clicks. A corner anchor's hit area extends slightly past the node's own shape, so hit-testing under it could resolve to an underlying node (e.g. an image) and hijack the drag instead of resizing. Guard the branch with selectedGroup.hasName('back') so anchor/rotater mousedowns fall through to the native Konva drag. Closes #1137 * test(nodes-selection): tighten hasName stub to assert 'back' guard hasName: () => true accepted any name, so these tests would still pass even if the pointerdown 'back' check regressed to match the wrong transformer child. Scope the stub to name === 'back' so the tests actually exercise the guard. * chore(deps): update package-lock.json Regenerate lockfile: bump transitive deps (babel 7.29.7 -> 7.29.8, azure/identity subdeps) and refresh registry resolution URLs. * docs: update release documentation Document the 5.2.1 changelog and release checklist. * fix(nodes-selection): scope back-shape listening toggle to itself registerStagePointerMove toggled the whole Transformer's listening attr to let clicks pass through the container's empty back overdraw. Since Konva's isListening() climbs the parent chain, this disabled every anchor/rotater too. None of the 4 conditions re-enabled listening when the pointer landed on an anchor overlapping an unrelated sibling shape, so listening got stuck false and anchors stopped receiving hover/pointer events (no cursor change, no resize). Toggle back.listening() directly instead: back is a sibling of the anchors/rotater, not their parent, so it can never disable them. Closes #1137 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix image cropping on Windows (#1144) * fix(image): restore crop cursor on modifier press Draw crop anchors before resolving the pointer so a stationary cursor receives the correct resize direction. Closes #1138 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(changelog): add crop cursor fix Refs #1138 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(groups): restore post-render selection * fix(groups): restore post-render selection Select the rendered replacement after state changes so the transformer does not retain destroyed nodes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(context-menu): preserve multi-selection Keep all selected nodes in the menu when a member of the selection is right-clicked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(changelog): finalize 5.2.1 notes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1138