import { Property } from '@nativescript/core';
import { Paint } from '../Paint';
export const p1Property = new Property({
    name: 'p1',
    valueConverter(value) {
        return parseFloat(value);
    },
});
export const p2Property = new Property({
    name: 'p2',
    valueConverter(value) {
        return parseFloat(value);
    },
});
export class Line extends Paint {
    draw() {
        if (this.p1 === undefined || this.p2 === undefined) {
            return;
        }
        const override_color = this.parent._overrideColor;
        const context = this._canvas.getContext('2d');
        const line = new Path2D();
        line.lineTo(this.p1, this.p2);
        const style = this.paintStyle;
        if (style === 'fill') {
            context.fillStyle = this.color.hex;
            context.fill(line);
        }
        else if (style === 'stroke') {
            context.strokeStyle = this.color.hex;
            context.stroke(line);
        }
    }
}
p1Property.register(Line);
p2Property.register(Line);
//# sourceMappingURL=Line.js.map