Repository navigation
Skew the transform box by Ctrl-dragging an edge - #615
Merged
Merged
Conversation
TransformBoxOptions.Skew turns a Ctrl-drag on an edge handle into a skew along that edge, the opposite edge staying put. TransformBoxRect gains a Skew (a shear about its centre) with Shape() and skewed Corners(); a skewed box keeps its slant when moved or resized. The demo, gallery tile, README and isolation tests cover it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PqnpZgNq3MNw8X8yEeUqJL
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PqnpZgNq3MNw8X8yEeUqJL
|
This was referenced Oct 12, 2026
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.



Requested by Matt · project thread
Before:
TransformBoxcould move, resize and scale a rectangle, but never slant it.After: with
TransformBoxOptions.Skewon, Ctrl-dragging an edge handle slides that edge along itself while the opposite edge stays put, turning the box into a parallelogram. ImageGui's Arrange tool needs this to skew layers.How:
TransformBoxRectgains aSkewinit property, a shear about the rectangle's centre, plusShape()(the shear as a matrix to fold into whatever the box frames),Center,IsSkewed, andCorners()now return the parallelogram.Min/Maxstay the unskewed rectangle, so an unskewed box behaves exactly as before. The stretch-or-skew choice is made at the press (TransformBoxDrag.Skew), andTransformBoxResult.Skewingreports it, or on hover what a press would do. Hit-testing follows the slant. A skewed box keeps its slant when moved or resized: the drag goes back into the unskewed rectangle and the handle's opposite edge or corner stays put. Skew is capped at 10 per axis, and two skews can't fold the box below a tenth of its area. The skew cursor points along the edge.Tests: 11 new
TransformBoxStateTests, 2 isolation UI tests (a Ctrl-drag skews; withSkewoff, Ctrl still stretches), and a demo UI test. The demo gains a "Ctrl skews" toggle and now keeps the layer as a matrix so it can hold a skew. The gallery tile shows a skewed box. README and CLAUDE.md are updated.🤖 Generated with Claude Code
https://claude.ai/code/session_01PqnpZgNq3MNw8X8yEeUqJL
Generated by Claude Code