[librsvg: 2/4] Round when converting userspace units to Pango units, which are ints



commit d8a9824eea6588dedc403aee8d51b3fbea1a509c
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Sep 27 10:32:50 2018 -0500

    Round when converting userspace units to Pango units, which are ints

 rsvg_internals/src/text.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index 3563c85d..3fa42ec3 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -384,7 +384,7 @@ impl NodeTrait for NodeTSpan {
 }
 
 fn to_pango_units(v: f64) -> i32 {
-    (v * f64::from(pango::SCALE)) as i32
+    (v * f64::from(pango::SCALE) + 0.5) as i32
 }
 
 impl From<FontStyle> for pango::Style {


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