[librsvg/librsvg-2.44] Round when converting userspace units to Pango units, which are ints
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.44] Round when converting userspace units to Pango units, which are ints
- Date: Thu, 27 Sep 2018 16:33:42 +0000 (UTC)
commit 5e32a7dc0a9ad0fafbba43c859b981dddce6cde3
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]