ScreenObjectEditor
Hit testing, positioning and proportional resizing for editable direct children of a composition.
screen supplies the composition size through its frame. Supply objects in drawing order (last drawn is frontmost); exclude background video or other objects that should not be edited. Register/unregister objects alongside scene insertion/removal. This editor does not attach, detach, reorder, or own their rendering resources, and does not handle gestures or selection UI.
All input coordinates are composition pixels. Call from one thread, as with direct frame changes. Bounds are taken from the most recent layout until edited, then retained at fractional precision so consecutive input events do not depend on rendering completing between events. Call invalidateBounds after changing an object's layout outside this editor.
Constructors
Functions
Whether an object is registered for editing.
Fits positioned and edited objects to the requested composition size.
Returns a copy of the current editing bounds, or null for an unregistered object.
Returns the frontmost visible registered object at point, or null outside the composition.
Discards cached geometry so subsequent operations use the object's next rendered bounds.
Moves the object's top-left corner, preserving its current size and clamping its position.
Registers an object at the front of the editable drawing order. Optionally centers its requested size at position, clamping its position inside the composition. Auto-sized dimensions retain their automatic layout behavior. Duplicate registrations are ignored.
Scales around anchor while moving that anchor to destination. Use equal points to zoom in place, or a scale of 1 to pan. The aspect ratio is preserved; the smaller dimension is limited by minimumSize and the larger size by the composition. Text font size scales too. Alignment and margins are resolved into a left/top frame. Invalid input returns false.
Stops editing an object and releases cached geometry without removing it from its scene.