mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-25 18:47:07 -06:00
With a shape layer's Gradient Fill or Gradient Stroke (or a property in it) selected, its Start Point and End Point show in the viewer as draggable crosshairs with a guide between them, as in After Effects. The points are in the space of the shape group holding the gradient, so they are mapped through the enclosing groups' transforms and the layer's (shapes::item_matrix), and a drag converts back the same way. A drag is one prop.set merge: one undo step, and on an animated point a keyframe at the current time. The hook runs after the viewer's own gestures, like the effect point controls, so a handle takes the press and the layer doesn't move. They follow View ▸ Show Layer Controls. Tests (ui_gradient_handles, only pre-existing APIs, all three fail without this): dragging the End Point moves it by the drag in one undo step without moving the layer; inside a moved, 200%-scaled group the handle sits where the group draws the point and a drag converts to group space; no handles unless the gradient or a property in it is selected, or with layer controls off. ui_effect_controls still passes.