Table of Contents

Interface IResizeOperation

Namespace
Icy.Design.Editor.Placement
Assembly
IcyUI.Design.dll

One resize gesture in progress. It remembers the element's state when the gesture started, so every update is computed from that state and rounding never accumulates.

public interface IResizeOperation
Extension Methods

Properties

Indicator

Gets the area the element will occupy in its container after the last Update(Vector2), in the container's local space, for the editor to outline; or null when the strategy has nothing beyond the element's own bounds to show.

RectangleF? Indicator { get; }

Property Value

RectangleF?

Remarks

The default implementation returns null.

Methods

Update(Vector2)

Computes the attributes for the handle dragged by delta since the gesture started.

IReadOnlyList<AttributeEdit> Update(Vector2 delta)

Parameters

delta Vector2

The pointer's offset from where the gesture started, in the container's local units.

Returns

IReadOnlyList<AttributeEdit>

The attribute values the element should have now.

Update(Vector2, bool)

Computes the attributes for the handle dragged by delta since the gesture started, with snapping turned on or off.

IReadOnlyList<AttributeEdit> Update(Vector2 delta, bool snap)

Parameters

delta Vector2

The pointer's offset from where the gesture started, in the container's local units.

snap bool

true to let the strategy snap the dragged edge to its guides (such as grid lines); false to follow the pointer exactly. The editor clears it while Alt is held.

Returns

IReadOnlyList<AttributeEdit>

The attribute values the element should have now.

Remarks

The default implementation ignores snap and calls Update(Vector2).