From 583f84e287ed271290109ffc1da78fdfe38ae52e Mon Sep 17 00:00:00 2001 From: relhamdi Date: Sun, 7 Jun 2026 10:30:17 +0200 Subject: [PATCH] Add comments --- web/widgets/lora_row_widget.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/widgets/lora_row_widget.js b/web/widgets/lora_row_widget.js index 854ea87..15ea774 100644 --- a/web/widgets/lora_row_widget.js +++ b/web/widgets/lora_row_widget.js @@ -39,6 +39,8 @@ export class LoraRowWidget { return [0, ROW_HEIGHT]; } + // --- Draw --- + draw(ctx, node, width, posY, height) { this.last_y = posY; const h = height ?? ROW_HEIGHT; @@ -135,6 +137,8 @@ export class LoraRowWidget { ctx.restore(); } + // --- Events --- + mouse(event, pos, node) { const x = pos[0]; const type = event.type; @@ -224,10 +228,14 @@ export class LoraRowWidget { return false; } + // --- Utils --- + _inHit(x, hit) { return x >= hit[0] && x <= hit[0] + hit[1]; } + // --- Menu --- + _showLoraMenu(event, node) { // Destroy any previous menu document.querySelector("._lora_picker_menu")?.remove(); @@ -358,7 +366,7 @@ export class LoraRowWidget { } } -// --- Utils--- +// --- Helpers --- // Fit string to width (truncate with ellipsis) const fitString = (ctx, str, maxWidth) => {