Commit Graph
4 Commits
Author SHA1 Message Date
SusieeTheFemboyandClaude Opus 5.5 5224414d28 Transform: Fit to Comp refuses a scale that overflows (#2198)
A shape's painted bounds can be tiny enough (a 1e-305 px rectangle) that
the fit scale overflows to infinity. Non-finite bounds are skipped and a
non-finite scale returns an error before anything is written, instead of
storing infinity in the document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 05:41:00 +01:00
SusieeTheFemboyandGLM-5.3-Flash a3a72d48aa Transform: Fit to Comp sizes shape and text layers by their painted bounds (#2198)
layer.transform's fit / fitWidth / fitHeight ops took the layer's size
from render::source_size, which returns (0, 0) for layers without a
source item — shapes and text — so the ops matched nothing and silently
did nothing, for the shortcut, the menu item and the command alike.

When the source size is empty and a fit op runs, the size falls back to
the layer's painted content bounds at the current time, and the anchor
goes to the bounds' centre: content bounds live in layer space, where a
shape is centred on the origin and text sits above its baseline, so
(w/2, h/2) would fill the frame but land off-centre. Reset and the
other ops keep the source size, so their defaults are unchanged.

The regression test asserts what the viewer shows — the painted bounds
mapped to comp space span [0, 0, 640, 360] after fit, and fitWidth
spans the width centred vertically — for a rect shape and a text layer.

Co-Authored-By: GLM-5.3-Flash <noreply@z.ai>
2026-10-29 05:22:57 +01:00
Dylan M. Taylor f20d22bf36 Refactor engine for strict Clippy checks 2026-10-28 06:09:21 +00:00
aiongg 4a5562c35b refactor(engine): move layer commands to cmd/layer/*.rs 2026-10-26 21:49:11 +00:00