/*
 * Copyright (C) 2016-2020 Kano Computing Ltd.
 * License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 */
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { property } from '../../decorators.js';
import { PartComponent } from '../../component.js';
export class TextComponent extends PartComponent {
    constructor() {
        super(...arguments);
        this.value = 'Text';
        this.color = '#000000';
    }
    render(ctx, el) {
        const halfHeight = el.clientHeight / 2;
        ctx.fillStyle = el.style.color || '#ffffff';
        ctx.font = "16px Bariol";
        ctx.fillText(el.textContent || '', halfHeight - 2, 6 + (halfHeight));
    }
}
__decorate([
    property({ type: String, value: 'Text' })
], TextComponent.prototype, "value", void 0);
__decorate([
    property({ type: String, value: '#000000' })
], TextComponent.prototype, "color", void 0);
//# sourceMappingURL=text-component.js.map