Scenic.Primitive.Transform.Scale (Scenic v0.10.3) View Source

Apply a scale matrix.

Increase or shrink by the provided multiplier. This can take two forms:

  • multiplier - scale both x and y directions by the same multiplier
  • {mul_x, mul_y} - scale x and y directions independently

Scaling is pinned to the sensible default for each primitive, or to the :pin that you assign explicitly.

Example:

graph
|> text("Scaled!", scale: 1.2)
|> text("Scaled!", scale: {1.0, 1.2}, pin: {10, 20})

Shortcut

Scaling is common enough that you can use :s as a shortcut.

Example:

graph
|> text("Scaled!", s: 1.2)