diagram_core/src/shapeops/frame.rs#
Source: lib/diagram_core/src/shapeops/frame.rs
shapeops::frame -- (JD21) a frame that follows its geometry (SP-05, "Rahmen folgt der Geometrie")
and Ausrichtungsfeld aktualisieren (SP-16)
geometry_bounds(doc, shape) the box of a shape's geometry in its local coordinates
fit_frame(tx, eng, shape) Width, Height, Pin to that box (after vertices changed)
update_alignment_box(tx, eng, shape) a group's box around its members; a shape's: fit_frame
Visio recomputes a shape's box when a vertex is edited or a row type changes, unless LockCalcWH
is set (belegt: [MS-VSDX]/ShapeSheet reference of LockCalcWH, "Alignment Boxes" of the Visio
2002 developer reference); Ausrichtungsfeld aktualisieren does it on request, for a group around
its members, also only without LockCalcWH (belegt: VBA Selection.UpdateAlignmentBox). How it
writes the cells is not documented; here (angenommen): the shape stays where it is on the page,
Angle and the flips stay, Width and Height become the box's size (a proportional formula keeps
its form), LocPin follows its own formula (mostly Width*0.5), the pin goes where the old frame
had the new local pin, and every geometry cell moves into the new box: absolute rows keep
"Width*k" with a new k (constants stay constants), relative rows get new fractions (the
ellipse of RelEllipticalArcTo a new C and D), NURBS(...) and POLYLINE(...) values their
points, a D of "Width/Height*k" a new k; a cell that names another geometry cell (a closing
row's Geometry1.X1) follows by itself. Connection points, control points and the text block
keep their formulas (they are relative to the box) -- also an assumption. A group's members get
their pins (and 1-D members their free ends) in the new box, "Sheet.<group>!Width*k" with a new
k, sizes that are proportional to the group keep their value. Bézier pieces count with their
extremes (not their control points), arcs with theirs.
fn geometry_bounds(doc: &Document, shape: ShapeRef) -> Option<[f64; 4]>the box of a shape's geometry in its local coordinates (x0, y0, x1, y1): lines by their ends, arcs and Bézier pieces with their extremes; hidden sections (NoShow) and InfiniteLine rows left out. None: no geometryfn fit_frame(tx: &mut Transaction, eng: &mut Engine, shape: ShapeRef) -> Result<bool, EditError>The frame follows the geometry (SP-05): Width, Height, Pin and LocPin to the box of the shape's geometry (geometry_bounds), the geometry rows into the new box, the shape staying where it is on the page (see the module comment). Only for a 2-D shape that is no group, and not with LockCalcWH or a guarded Width or Height -> whether it changedfn update_alignment_box(tx: &mut Transaction, eng: &mut Engine, shape: ShapeRef) -> Result<bool, EditError>Ausrichtungsfeld aktualisieren (SP-16): a group's box around its members (2-D ones by their frames, 1-D ones by their ends) and its own geometry, the members staying where they are on the page; a shape that is no group gets the box of its geometry (fit_frame). Not with LockCalcWH -> whether it changed