The two boxed icons at the right of the menu bar were sitting on its rule. Both are drawn in ink, and a box that comes within a pixel of a line of the same colour stops reading as a box near a line and starts reading as one shape that has gone wrong. The box was not the problem. bar_h is a fraction of the height it has with a floor under it, and the floor was fourteen units — picked without reference to what the bar actually holds. An icon is nine units of glyph, half a unit of air each side and a hairline each side, which is twelve; the strip they sit in is inset a unit at each end. Fourteen was therefore handing a twelve-unit box a twelve-unit strip, and at the upscales where the fraction gives way to the floor they met the rule exactly. Twelve and two of clearance above and below and the two units of inset is eighteen, and that is what the floor is now derived from rather than asserted. Nothing else moves: every viewport whose fraction already cleared the floor is untouched, and only the ones sitting on it grow.
- commit
- b439fc8d2f99aad07a2147f45aa177b75cebd6fd
- parent
- 8f9d8df8c5e9215409ed8cf35798861df32e645d
- author
- Dami <dami.etoile@gmail.com>
| M | assets/ | 17 | ++++++++++------- |
| M | src/ | 14 | +++++++++++++- |
@@ -86,13 +86,16 @@ body {
8686 rectangle every time. */8787 .iconbtn {8888 display: flex; align-items: center; justify-content: center;89- /* Two units smaller than it wants to be, taken off the padding rather than the90- glyph: the glyph is drawn on a 9-unit grid and only stays on whole pixels91- while its box is a whole multiple of 9. The two units buy clearance from the92- menu bar's own rule below — both are drawn in ink, and a box that comes93- within a pixel of a line of the same colour stops reading as a box near a94- line and starts reading as one shape that has gone wrong. */95- padding: calc(1.5px * var(--s)) ;89+ /* Half a unit of air inside the frame, and no more. The glyph is drawn on a90+ 9-unit grid and only stays on whole pixels while its box is a whole91+ multiple of 9, so the padding is the only place a change can come from —92+ and it is not free: nine, a half each side and the hairline each side is93+ twelve, and twelve is the number the menu bar's floor is derived from, so94+ every unit added here is a unit the shortest bar has to grow to keep its95+ rule clear of the box. Half a unit is enough to stop the glyph fusing with96+ the frame; the clearance below is bought in the bar's height instead, which97+ is where it always belonged. */98+ padding: calc(0.5px * var(--s)) ;9699 border-color: var(--ink) ;97100 }98101 .iconbtn svg {@@ -238,9 +238,21 @@ fn metrics_for(mode: Mode, scale: Float, box: Box) -> Layout {
238238 // bar that stopped short of the edges would read as a strip of window. It is239239 // proportioned against the height it has: a bar taking a twentieth of a tall240240 // column would take a tenth of a short one.241+ //242+ // The floor under the fraction is not a taste number, it is the tallest thing243+ // the bar carries plus the air that thing needs. The boxed icons at the right244+ // are twelve units square; they want two units of clearance above and below,245+ // because both the box and the bar's rule are drawn in ink and a box that246+ // comes within a pixel of a line of the same colour stops reading as a box247+ // near a line and starts reading as one shape that has gone wrong; and the248+ // strip the buttons sit in is inset a unit at each end so it never lands on249+ // that rule. Twelve and six is eighteen. At fourteen the fraction was quietly250+ // handing the icons a bar exactly as tall as they are, which is how they came251+ // to sit on the rule at the upscales where the fraction gives way to the252+ // floor.241253 let bar_h =242254 int.max(243- 14,255+ 18,244256 round(int.to_float(vh) *. case split {245257 True -> 0.07246258 False -> 0.048