The zoom transform helpers (spec/10 §7.6), visualize's Visualize.Hooks.Zoom: the
transform FrameZoom writes on the drawing's zoom group, translate(x,y) scale(k), as
%{k, x, y}, so the server reads what the client did with the same arithmetic. The
transform is client-side: it costs the server nothing; the hook emits "zoom" only
when the view needs more detail, "view" when a geographic pan ends, "reset" on a
double-click.
iex> t = Macaw.Frame.Hooks.Zoom.scale_transform(Macaw.Frame.Hooks.Zoom.identity_transform(), 2, {10, 10})
iex> Macaw.Frame.Hooks.Zoom.transform_point({10, 10}, t)
{10, 10}
Summary
Functions
The identity: %{k: 1, x: 0, y: 0}.
The point the transform takes to {x, y}; a transform of scale zero answers a fault.
The transform scaled by scale about {cx, cy}, which stays where it is.
A point under the transform: {x·k + tx, y·k + ty}.
The transform moved by {dx, dy}.
Types
@type error() :: {:error, [Macaw.Base.Fault.t()]}
A refusal: faults with their paths.
A zoom transform: scale k and translation x, y.
Functions
@spec identity_transform() :: t()
The identity: %{k: 1, x: 0, y: 0}.
The point the transform takes to {x, y}; a transform of scale zero answers a fault.
The transform scaled by scale about {cx, cy}, which stays where it is.
A point under the transform: {x·k + tx, y·k + ty}.
The transform moved by {dx, dy}.