From a2008bac7c0c9b8ed2cb37f884547ad854624253 Mon Sep 17 00:00:00 2001 From: sqwishy Date: Fri, 4 Aug 2023 15:08:01 -0700 Subject: [PATCH] floating preview, round font metrics descent - preview area floats/sticky as you scroll so it's visible - Some fonts report many different values for their alphanumberics in actualBoundingBoxDescent. Like a range of numbers between 0 and 1 for letters without obvious hangy downy bits. Other fonts report 0 for a lot of them and then 0.25 or 0.37 or something (depending on the font) for some letters. Since descent is using Math.ceil, in the second case you get a lot of variation where some alphanumberics are zero and some are one and in-game the letters are up and down bouncing all over the place. Now uses Math.round intead of Math.ceil so that 0 actualBoundingBoxDescent is grouped with a bunch of other values? --- atlast.html | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/atlast.html b/atlast.html index facedf9..02bdbfa 100644 --- a/atlast.html +++ b/atlast.html @@ -13,6 +13,12 @@ align-items: center; grid-gap: 1em } +.canvas-float + { position: sticky; top: 0 } +.canvas-float label, .canvas-float small + { background: var(--pale); + outline: 2px solid var(--pale) } + textarea, input { font: inherit; color: inherit } @@ -20,7 +26,7 @@ { width: 100% } h1, label - { display: block; color: var(--muted) } + { color: var(--muted) } label { font-size: smaller } @@ -74,8 +80,8 @@ .option-group { display: flex; grid-gap: 1.5ch } -.smol - { flex-grow: 0 } +.smol-button-thing + { flex-grow: 0; display: flex; align-items: end } hr { border: 0; @@ -88,10 +94,12 @@
-

- -

?x?, row height ? px, size ? kbytes - +

+ + ?x?, row height ? px, size ? kbytes + + +