@@ -283,9 +283,9 @@ impl WgpuRenderer {
283283 //
284284 // Rendering order:
285285 // 1. Backgrounds (window bg, stretches, char bg)
286- // 2. Text (mask glyphs, color glyphs, composed )
287- // 3. Decorations (underline, overline, strikethrough )
288- // 4. Box borders (sharp and rounded )
286+ // 2. Box borders (sharp and rounded )
287+ // 3. Text (mask glyphs, color glyphs, composed )
288+ // 4. Decorations (underline, overline, strikethrough )
289289 // 5. Inline media (images, videos, webkit)
290290 // 6. Cursors, borders, scroll bars (on top)
291291 let mut bg_vertices: Vec < RectVertex > = Vec :: new ( ) ;
@@ -1449,6 +1449,29 @@ impl WgpuRenderer {
14491449 pass. draw ( 0 ..rounded_fill_vertices. len ( ) as u32 , 0 ..1 ) ;
14501450 }
14511451
1452+ // GNU draws character/composition box relief before the glyph so
1453+ // thick inset borders cannot cover a narrow character cell.
1454+ if let Some ( upload) =
1455+ self . arenas
1456+ . rect
1457+ . upload ( & self . device , & self . queue , & sharp_border_vertices)
1458+ {
1459+ pass. set_pipeline ( rect_pl) ;
1460+ pass. set_bind_group ( 0 , & self . uniform_bind_group , & [ ] ) ;
1461+ pass. set_vertex_buffer ( 0 , upload. buffer_slice ( ) ) ;
1462+ pass. draw ( 0 ..sharp_border_vertices. len ( ) as u32 , 0 ..1 ) ;
1463+ }
1464+ if let Some ( upload) =
1465+ self . arenas
1466+ . rounded
1467+ . upload ( & self . device , & self . queue , & rounded_border_vertices)
1468+ {
1469+ pass. set_pipeline ( rounded_rect_pl) ;
1470+ pass. set_bind_group ( 0 , & self . uniform_bind_group , & [ ] ) ;
1471+ pass. set_vertex_buffer ( 0 , upload. buffer_slice ( ) ) ;
1472+ pass. draw ( 0 ..rounded_border_vertices. len ( ) as u32 , 0 ..1 ) ;
1473+ }
1474+
14521475 // --- Draw mask text glyphs ---
14531476 if !mask_data. is_empty ( ) {
14541477 let all_vertices: Vec < GlyphVertex > = mask_data
@@ -1593,30 +1616,6 @@ impl WgpuRenderer {
15931616 pass. draw ( 0 ..decoration_vertices. len ( ) as u32 , 0 ..1 ) ;
15941617 }
15951618
1596- // --- Draw sharp box borders ---
1597- if let Some ( upload) =
1598- self . arenas
1599- . rect
1600- . upload ( & self . device , & self . queue , & sharp_border_vertices)
1601- {
1602- pass. set_pipeline ( rect_pl) ;
1603- pass. set_bind_group ( 0 , & self . uniform_bind_group , & [ ] ) ;
1604- pass. set_vertex_buffer ( 0 , upload. buffer_slice ( ) ) ;
1605- pass. draw ( 0 ..sharp_border_vertices. len ( ) as u32 , 0 ..1 ) ;
1606- }
1607-
1608- // --- Draw rounded box borders ---
1609- if let Some ( upload) =
1610- self . arenas
1611- . rounded
1612- . upload ( & self . device , & self . queue , & rounded_border_vertices)
1613- {
1614- pass. set_pipeline ( rounded_rect_pl) ;
1615- pass. set_bind_group ( 0 , & self . uniform_bind_group , & [ ] ) ;
1616- pass. set_vertex_buffer ( 0 , upload. buffer_slice ( ) ) ;
1617- pass. draw ( 0 ..rounded_border_vertices. len ( ) as u32 , 0 ..1 ) ;
1618- }
1619-
16201619 // --- Draw inline images ---
16211620 pass. set_pipeline ( image_pl) ;
16221621 pass. set_bind_group ( 0 , & self . uniform_bind_group , & [ ] ) ;
0 commit comments