Skip to main content

max / makeover-immediate

Say why the mitred corner is the answer here, not a concession makeover-layout now holds that the two corners where the runs meet belong to both edges, and makeover-tui splits them. This renderer does not, and the reason is resolution rather than disagreement: at the default one-point stroke the corner is a one-point square, so dividing it is sub-pixel and antialiasing gives back the blend the mitre already produced. A seam and no information. Also fixes a rustdoc warning in the header: `makeover-tui` was written as an intra-doc link, which cannot resolve across a hyphen.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-30 17:27 UTC
Signed with PGP, not checked
Commit: 2bde5cc109e7ef7f123a37419196a561baf206bf
Parent: 476b2ec
1 file changed, +11 insertions, -1 deletion
M src/lib.rs +11 -1
@@ -2,7 +2,7 @@
2 2 //!
3 3 //! <!-- wiki: makeover-immediate -->
4 4 //!
5 - //! Named for the mode, not the library, the way [`makeover-tui`] is named for
5 + //! Named for the mode, not the library, the way `makeover-tui` is named for
6 6 //! the target and not for ratatui. Immediate mode is the constraint that
7 7 //! actually separates this renderer from the other two, and egui is the
8 8 //! backend it is written against.
@@ -146,6 +146,16 @@
146 146 ///
147 147 /// Two three-point polylines meeting at opposite corners, rather than four
148 148 /// segments, so egui mitres the corner joins instead of leaving a notch.
149 + ///
150 + /// The dark polyline is drawn second, so the two corners where the runs meet
151 + /// take its tone. That is the right answer here rather than a concession.
152 + /// [`makeover_layout::Bevel`] holds those corners to belong to both edges, and
153 + /// a renderer with room to divide one should; at the default one-point stroke
154 + /// the corner is a one-point square, so the division is sub-pixel and
155 + /// antialiasing resolves it to the same blend the mitre already gives. Splitting
156 + /// it would add a seam and no information. `makeover-tui` does split, because a
157 + /// terminal cell is large enough that not splitting costs a visible cell of edge
158 + /// weight — the same rule, at a resolution where it has something to say.
149 159 pub fn paint_bevel(painter: &Painter, rect: Rect, bevel: Bevel, palette: &Palette, stroke: f32) {
150 160 let (top_left, bottom_right) = bevel.edges();
151 161