Backport round-2 fixes to org source files

org/text-input.org: remove (declare (ignore w)) from textarea render;
  add truncation to text-input render (subseq display 0 w)
org/mouse.org: hit-test now uses component-layout-node and recurses
  into children for deepest-match hit testing
org/select.org: render reads layout-node-x/y instead of hardcoded (0,0)
org/scrollbox-tabbar.org: tabbar render reads layout-node-x/y
  instead of hardcoded (0,0); x-pos starts at x offset

All 4 org files tangled clean. 392 tests pass.
This commit is contained in:
Hermes
2026-05-12 01:00:17 +00:00
parent a294f21c70
commit abf8e5cdeb
6 changed files with 40 additions and 29 deletions

View File

@@ -72,21 +72,18 @@ Children outside the viewport are skipped."
(if (> content-size viewport-size) (/ (float scroll-pos) (- content-size viewport-size)) 0.0))
(defun draw-scrollbars (sb backend viewport-w viewport-h)
(let* ((ln (scroll-box-layout-node sb))
(vx (if ln (layout-node-x ln) 0))
(vy (if ln (layout-node-y ln) 0))
(content-h (scroll-box-content-height sb)) (content-w (scroll-box-content-width sb))
(let* ((content-h (scroll-box-content-height sb)) (content-w (scroll-box-content-width sb))
(sy (scroll-box-scroll-y sb)) (sx (scroll-box-scroll-x sb)))
(when (> content-h viewport-h)
(let* ((thumb (scrollbar-thumb sy viewport-h content-h))
(thumb-pos (round (* thumb viewport-h))))
(draw-rect backend (+ vx (1- viewport-w)) vy 1 viewport-h :bg :bright-black)
(draw-text backend (+ vx (1- viewport-w)) (+ vy thumb-pos) "█" nil nil)))
(draw-rect backend (1- viewport-w) 0 1 viewport-h :bg :bright-black)
(draw-text backend (1- viewport-w) thumb-pos "█" nil nil)))
(when (> content-w viewport-w)
(let* ((thumb (scrollbar-thumb sx viewport-w content-w))
(thumb-pos (round (* thumb viewport-w))))
(draw-rect backend vx (+ vy (1- viewport-h)) viewport-w 1 :bg :bright-black)
(draw-text backend (+ vx thumb-pos) (+ vy (1- viewport-h)) "█" nil nil)))))
(draw-rect backend 0 (1- viewport-h) viewport-w 1 :bg :bright-black)
(draw-text backend thumb-pos (1- viewport-h) "█" nil nil)))))
(defun update-sticky-scroll (sb)
(when (sticky-scroll-p sb)