Curves.Drawing.Group (curves v1.0.1)

Copy Markdown View Source

A group of shapes from an SVG's <g> (or <a> or <switch>), kept so that drawing the Curves.Drawing again looks the same: a group's opacity, filter or clip-path applies to everything in it together.

FieldWhat it holds
:element"g", "a" or "switch"
:idits id attribute, or nil
:attributesits own attributes, as strings, except transform: that is already applied to the shapes inside, and kept on each of them (see Curves.Drawing.Shape)
:transformevery SVG transform that applied to it (its own and its groups'), as one matrix {a, b, c, d, e, f}, like a shape's. Curves.Svg draws the group with it, so its clip-path, mask or filter lines up with the shapes inside as it did. A group made by hand can leave it as it is: it never changes where the shapes are drawn.
:childrenwhat is inside it, in order: Curves.Drawing.Shape, Curves.Drawing.Group and Curves.Drawing.Raw
:origin, :scale, :rotationhow Curves.Transform has moved, scaled and rotated the whole group (everything in it, text too). They start at {0.0, 0.0}, 1.0 and 0.0.

Summary

Types

t()

@type t() :: %Curves.Drawing.Group{
  attributes: %{required(String.t()) => String.t()},
  children: [Curves.Drawing.child()],
  element: String.t(),
  id: String.t() | nil,
  origin: Curves.Types.point_tuple(),
  rotation: float(),
  scale: number() | {number(), number()},
  transform: Curves.Drawing.matrix()
}