Add pixel-size fit and drag-to-reorder in the hierarchy
The aspect button now carries two offers, so it becomes a menu: fit one side to the texture ratio, or set both sides to the exact pixel size as a single undo step. Dropping a row on the outer quarter of another row inserts it into that gap instead of parenting into it, reordering among the siblings there. Order is the stored order, so ReorderObjectCommand is a splice; equal z falls back to tree order, which makes this the way to draw one object in front of another. Rejected on container content like the other structural edits. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f40b8a0523
commit
4568c6581b
17 files changed
+416
-85
No files matched your search
@@ -33,6 +33,15 @@ export function fitAxisToAspect(size: PixelSize, props: PropertyBag, axis: SizeA
|
||||
return Number.isFinite(fitted) && fitted > 0 ? fitted : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the sprite is drawn at the picture's own pixel size – one image pixel per world unit.
|
||||
* Exact, unlike `matchesAspect`: these two numbers are written as they are, with no division in
|
||||
* between that could cost a digit.
|
||||
*/
|
||||
export function matchesPixelSize(size: PixelSize, props: PropertyBag): boolean {
|
||||
return Number(props.width) === size.w && Number(props.height) === size.h;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the sprite already has the picture's proportions. Compared as a cross product with a
|
||||
* relative tolerance, because fitting one side and then asking about the other must not answer
|
||||
|
||||
Reference in new issue
Block a user