Skip to content

Line ​

Line stroke passing through points.

Line example

Examples ​

js
import { Line } from "pencil.js";

const options = {
    stroke: "red",
    strokeWidth: 9,
};
const line = new Line(from, [firstPoint, secondPoint, lastPoint], options);

LineOptions ​

Inherit from ComponentOptions.

NameTypeDefaultComment
capStringLine.caps.roundHow the line end points looks
joinStringLine.joins.roundHow the line segment are join
fillColor or StringnullColor used to fill, set to null for transparent
strokeColor or StringComponent.defaultOptions.fillColor used to stroke, set to null for transparent
absoluteBooleanfalseShould points be treated as absolute coordinates

Released under the MIT License.