From 412ec63380382232d982c0f4140d00f0be5970d5 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 8 Aug 2025 13:28:37 -0500 Subject: [PATCH] Fix borders causing layout overflow --- src/shortcutter/Main_.kiss | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/shortcutter/Main_.kiss b/src/shortcutter/Main_.kiss index 757db77..229867a 100644 --- a/src/shortcutter/Main_.kiss +++ b/src/shortcutter/Main_.kiss @@ -18,6 +18,7 @@ .misc-items table:nth-child(1) > tbody:nth-child(1) > tr > td > div .chart-map-container + .sea-sector .extra-locations") (function :Int countTabLevel [:String line] @@ -68,7 +69,7 @@ (Browser.window.document.body.appendChild element) element))) -(var keys (.split "1234567890abcdefghijklmnopqrstuvwxyz" "")) +(var keys (.split "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" "")) (function :Null selectHierarchy [:Hierarchy level :Bool on &opt :Element element] (localVar labels (labelsElement)) @@ -80,16 +81,21 @@ // Highlight the element as selectable and show its key (when on (let [bounds (element.getBoundingClientRect) + div (Browser.window.document.createElement "div") label (Browser.window.document.createElement "p")] (set label.innerHTML (nth keys idx)) (set label.style.color "red") - (set label.style.position "absolute") - (set label.style.top "$(+ bounds.top Browser.window.scrollY)px") + (set div.style.position "absolute") + (set div.style.top "$(+ bounds.top Browser.window.scrollY)px") + (set div.style.left "$(+ bounds.left Browser.window.scrollX)px") + (set div.style.width "${bounds.width}px") + (set div.style.height "${bounds.height}px") (set label.style.margin "0px") - (set label.style.left "$(+ bounds.left Browser.window.scrollX)px") (set label.style.fontSize "3em") - (labels.appendChild label))) - (set element.style.border (if on "2px solid red" ""))) + (set div.style.border "2px solid red") + (div.appendChild label) + (labels.appendChild div))) + ) (when retry (Browser.window.setTimeout ->(selectHierarchy level on element) 500))))) (function :Null popHierarchy []