Skip to main content

Line

Draws a line between the given points using the given paint.

Note

The line is always rendered as a stroke, regardless of the value of paint's style property.

Inherits: canvas.Shape

Properties

  • paint - A style to draw a line with.
  • x1 - The x-axis coordinate of the line's starting point.
  • x2 - The x-axis coordinate of the line's end point.
  • y1 - The y-axis coordinate of the line's starting point.
  • y2 - The y-axis coordinate of the line's end point.

Properties

paintclass-attributeinstance-attribute

paint: Paint = field(default_factory=(lambda: Paint()))

A style to draw a line with.

x1instance-attribute

x1: Number

The x-axis coordinate of the line's starting point.

x2instance-attribute

x2: Number

The x-axis coordinate of the line's end point.

y1instance-attribute

y1: Number

The y-axis coordinate of the line's starting point.

y2instance-attribute

y2: Number

The y-axis coordinate of the line's end point.