From 399280d9c4f9a96eecaa0a3952a73f711f058e28 Mon Sep 17 00:00:00 2001 From: cqc Date: Fri, 2 Sep 2022 21:34:47 -0500 Subject: [PATCH] correct? rendering --- dune | 6 +----- human.ml | 13 +++++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/dune b/dune index 08f7608..5124748 100644 --- a/dune +++ b/dune @@ -1,10 +1,6 @@ (env (dev (flags (:standard -warn-error -A)) - (js_of_ocaml (flags --pretty --no-inline --source-map --debug-info) (compilation_mode separate))) - - -) - + (js_of_ocaml (flags) (compilation_mode separate)))) (executable (name boot_js) diff --git a/human.ml b/human.ml index 41c9dbd..eeccf48 100644 --- a/human.ml +++ b/human.ml @@ -374,14 +374,12 @@ module Display = struct let path_box vg color ?(width = 0.) b = let module Path = NVG.Path in - NVG.save vg ; Path.begin_ vg ; Path.rect vg ~x:(Box2.ox b) ~y:(Box2.oy b) ~w:(Box2.w b) ~h:(Box2.h b) ; if width != 0. then NVG.set_stroke_width vg ~width ; NVG.set_stroke_color vg ~color ; NVG.stroke vg ; - NVG.restore vg ; Box2.max b (* Display.state.box as supplied to a widget defines the allowed drawing area for the widget. @@ -849,7 +847,8 @@ module Panel = struct let x, y = (V2.x t, V2.y t +. metrics.ascender) in F.epr "Panel.Ui.Draw.uchar x=%f y=%f \"%s\" @." x y text ; Text.text vg ~x ~y text ; - P2.v bounds.advance + P2.v + (P2.x t +. bounds.advance) ( P2.y t +. metrics.ascender +. metrics.descender +. metrics.line_height ) @@ -905,9 +904,11 @@ module Panel = struct | `Atom a -> atom t b a | `Attr a -> attr t b a | `Join a -> join t b a in - Display.path_box t.vg - (Color.rgbaf ~r:1. ~g:0. ~b:0. ~a:0.2) - (Box2.v b b2) + ignore + (Display.path_box t.vg + (Color.rgbaf ~r:1. ~g:0. ~b:0. ~a:0.2) + (Box2.of_pts b b2) ) ; + b2 end module Action = struct