@@ -302,11 +302,10 @@ pub fn text_lines(
302302 } ;
303303 let metrics = line. metrics ( ) ;
304304
305- if let Some ( h) = params. max_h {
306- if metrics. baseline + metrics. descent > h {
305+ if let Some ( h) = params. max_h
306+ && metrics. baseline + metrics. descent > h {
307307 break ;
308308 }
309- }
310309
311310 let line_y = base_y + metrics. baseline - metrics. ascent ;
312311 let line_text = & content[ line. text_range ( ) ] ;
@@ -347,11 +346,10 @@ pub fn text_glyph_rects(
347346 } ;
348347 let metrics = line. metrics ( ) ;
349348
350- if let Some ( h) = params. max_h {
351- if metrics. baseline + metrics. descent > h {
349+ if let Some ( h) = params. max_h
350+ && metrics. baseline + metrics. descent > h {
352351 break ;
353352 }
354- }
355353
356354 for item in line. items ( ) {
357355 let PositionedLayoutItem :: GlyphRun ( glyph_run) = item else {
@@ -1024,7 +1022,7 @@ fn tessellate_layout(
10241022 let font_data = run. font ( ) ;
10251023 let font_size = run. font_size ( ) ;
10261024 let normalized_coords = run. normalized_coords ( ) ;
1027- let color = glyph_run. style ( ) . brush . clone ( ) ;
1025+ let color = glyph_run. style ( ) . brush ;
10281026
10291027 let Ok ( font_ref) = FontRef :: from_index ( font_data. data . as_ref ( ) , font_data. index ) else {
10301028 continue ;
@@ -1044,7 +1042,7 @@ fn tessellate_layout(
10441042 let glyph_color = glyph_colors
10451043 . filter ( |colors| !colors. is_empty ( ) )
10461044 . map ( |colors| colors[ glyph_index % colors. len ( ) ] )
1047- . unwrap_or ( color. clone ( ) ) ;
1045+ . unwrap_or ( color) ;
10481046 glyph_index += 1 ;
10491047
10501048 let glyph_id = skrifa:: GlyphId :: new ( glyph. id ) ;
@@ -1061,7 +1059,7 @@ fn tessellate_layout(
10611059
10621060 let translated = translate_path_flip_y ( & path, tx, ty) ;
10631061
1064- let mut builder = MeshBuilder :: new ( mesh, glyph_color. clone ( ) ) ;
1062+ let mut builder = MeshBuilder :: new ( mesh, glyph_color) ;
10651063 let _ = fill_tess. tessellate_path (
10661064 & translated,
10671065 & FillOptions :: default ( ) ,
@@ -1088,7 +1086,7 @@ fn stroke_layout(
10881086
10891087 let glyph_paths = extract_glyph_lyon_paths ( layout, base_x, base_y, max_h) ;
10901088 for path in & glyph_paths {
1091- let mut builder = MeshBuilder :: new ( mesh, color. clone ( ) ) ;
1089+ let mut builder = MeshBuilder :: new ( mesh, color) ;
10921090 let _ = stroke_tess. tessellate_path ( path, & stroke_opts, & mut builder) ;
10931091 }
10941092}
0 commit comments