2024-09-08 12:09:14 +02:00
|
|
|
export class BrushPreview extends HTMLElement {
|
2025-06-19 13:48:07 +02:00
|
|
|
constructor(width, height) {
|
2024-09-08 12:09:14 +02:00
|
|
|
super();
|
2025-06-19 13:48:07 +02:00
|
|
|
|
|
|
|
this.width = width;
|
|
|
|
this.height = height;
|
2024-09-08 12:09:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
connectedCallback() {
|
2025-09-05 17:41:25 +02:00
|
|
|
// TODO
|
2024-09-08 12:09:14 +02:00
|
|
|
}
|
|
|
|
|
2024-09-08 13:53:29 +02:00
|
|
|
async #renderBrushInner(haku) {
|
2025-09-05 17:41:25 +02:00
|
|
|
// TODO
|
2024-09-08 12:09:14 +02:00
|
|
|
return { status: "ok" };
|
|
|
|
}
|
|
|
|
|
2024-09-08 13:53:29 +02:00
|
|
|
async renderBrush(haku) {
|
2024-09-08 12:12:33 +02:00
|
|
|
this.unsetErrorFlag();
|
2024-09-08 13:53:29 +02:00
|
|
|
let result = await this.#renderBrushInner(haku);
|
2024-09-08 12:09:14 +02:00
|
|
|
if (result.status == "error") {
|
2025-06-19 13:48:07 +02:00
|
|
|
console.error(result);
|
2024-09-08 12:12:33 +02:00
|
|
|
this.setErrorFlag();
|
2024-09-08 12:09:14 +02:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
2024-09-08 12:12:33 +02:00
|
|
|
|
|
|
|
unsetErrorFlag() {
|
|
|
|
this.classList.remove("error");
|
|
|
|
}
|
|
|
|
|
|
|
|
setErrorFlag() {
|
|
|
|
this.classList.add("error");
|
|
|
|
}
|
2024-09-08 12:09:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
customElements.define("rkgk-brush-preview", BrushPreview);
|