import { Property } from '@nativescript/core';
import { Paint } from '../Paint';
import { Path2D } from '../../Canvas2D';
export const pathProperty = new Property({
    name: 'path',
});
export class Path extends Paint {
    [pathProperty.setNative](value) {
        if (value) {
            this._path = new Path2D(value);
        }
    }
    draw() {
        if (this._path === undefined) {
            return;
        }
        const override_color = this.parent._overrideColor;
        const context = this._canvas.getContext('2d');
        const style = this.paintStyle;
        if (style === 'fill') {
            context.fillStyle = this.color.hex;
            context.fill(this._path);
        }
        else if (style === 'stroke') {
            context.strokeStyle = this.color.hex;
            context.stroke(this._path);
        }
    }
}
pathProperty.register(Path);
//# sourceMappingURL=Path.js.map