[librsvg: 3/22] Check my assumptions about a layout's extents for RTL text




commit e4dc9bacdb528ce03109d8f98d1d7a7c88d6416e
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Sep 22 19:15:11 2021 -0500

    Check my assumptions about a layout's extents for RTL text
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/593>

 src/text.rs | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/text.rs b/src/text.rs
index 244ba152..f9573389 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -198,6 +198,10 @@ impl MeasuredSpan {
         let w = f64::from(w) / f64::from(pango::SCALE);
         let h = f64::from(h) / f64::from(pango::SCALE);
 
+        // This is the logical size of the layout, regardless of text direction, so it's always positive.
+        assert!(w >= 0.0);
+        assert!(h >= 0.0);
+
         let advance = if values.writing_mode().is_vertical() {
             (0.0, w)
         } else {


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