Skip to content
PathCommand

PathCommand

Mojo struct 🡭

PathCommand

@memory_only
struct PathCommand

One path command, as Path.commands records it. Which of p1/p2/p3 matter depends on op: MOVE_TO/LINE_TO use p1 (endpoint); QUAD_TO uses p1 (control) and p2 (endpoint); CUBIC_TO uses all three (control1, control2, endpoint); CLOSE uses none; ARC_TO packs five scalars across the three points – p1 = (cx, cy), p2 = (radius, start_angle), p3.x = end_angle, p3.y unused. Unused fields are zeroed.

Fields

  • op (PathOp)
  • p1 (FPoint)
  • p2 (FPoint)
  • p3 (FPoint)

Implemented traits

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable

Methods

__init__

fn def __init__(out self, op: PathOp, p1: FPoint, p2: FPoint, p3: FPoint)

Args:

  • op (PathOp)
  • p1 (FPoint)
  • p2 (FPoint)
  • p3 (FPoint)
  • self (Self)

Returns:

Self