[librsvg: 8/20] Create the array for positioned spans right where it is needed




commit 3fb062bd126b6cca7044d16d9c73f469dbaecdaf
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Oct 19 18:44:39 2021 -0500

    Create the array for positioned spans right where it is needed
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/616>

 src/text.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/text.rs b/src/text.rs
index 3fd9f0a2..d99779e9 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -145,8 +145,6 @@ impl PositionedChunk {
         x: f64,
         y: f64,
     ) -> PositionedChunk {
-        let mut positioned = Vec::new();
-
         let chunk_direction = measured.values.direction();
 
         let advance = measured.spans.iter().fold((0.0, 0.0), |acc, measured| {
@@ -167,6 +165,8 @@ impl PositionedChunk {
 
         // Position each span
 
+        let mut positioned = Vec::new();
+
         for mspan in &measured.spans {
             let params = NormalizeParams::new(&mspan.values, view_params);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]