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
@@ -42,7 +42,7 @@ import {
|
||||
} from '../../core/properties/resolve';
|
||||
import { Button, Dropdown, Label, Menu, type MenuItem, TextField } from '../../ui';
|
||||
import { addCollider, createContainer, removeObjects } from '../actions';
|
||||
import { aspectActions } from './aspectAction';
|
||||
import { aspectActions, sizeCommand } from './aspectAction';
|
||||
import { createFieldRow, type FieldActions, type FieldRow, labelledRow } from './fieldFactory';
|
||||
import { addGap, addNote, addTitle, type InspectorHost } from './host';
|
||||
import { previewingHandlers } from './previewHandlers';
|
||||
@@ -379,7 +379,10 @@ function propertyRow(
|
||||
owner,
|
||||
def,
|
||||
() => currentProps(host.state, holderId, objectId),
|
||||
(value) => host.state.execute(new SetOverrideCommand(holderId, objectId, def.key, value)),
|
||||
(values) =>
|
||||
host.state.execute(
|
||||
sizeCommand(values, (axis, value) => new SetOverrideCommand(holderId, objectId, axis, value)),
|
||||
),
|
||||
),
|
||||
reset: () => {
|
||||
const { template, asset } = bases();
|
||||
|
||||
Reference in new issue
Block a user