for TextLayout<'a, P> {
let image = &mut *image;
// Skips the calculation of offsets
- if self.x_anchor == HorizontalAnchor::Left && self.y_anchor == VerticalAnchor::Top {
+ if self.x_anchor == HorizontalAnchor::Left
+ && self.y_anchor == VerticalAnchor::Top
+ && self.align == TextAlign::Left
+ {
render_layout(image, &self.fonts, &self.inner);
+ return;
}
let (widths, max_width, fx, ox, oy) = self.calculate_offsets();
From eb88f6906e0d635ddc5b90162e60f85b7da21eef Mon Sep 17 00:00:00 2001
From: Jay3332 <40323796+jay3332@users.noreply.github.com>
Date: Mon, 18 Mar 2024 19:54:15 -0400
Subject: [PATCH 5/7] add text fixes to changelog
---
CHANGELOG.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 211d53d53..a8eec6909 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@ Versions prior to v0.7 are not tagged/released on GitHub.
## v0.11 (dev)
- Add `PngEncoderOptions::new`
+### Bug fixes
+- Fix text alignment rendering duplicately ([#28])
+- Fix `TextLayout`s with varying fonts not registering properly ([#29])
+
## v0.10.1 (2023-10-14)
- Fix encoding image sequences not respecting delay and disposal method
From c004ec0827d42ada18731ed1b02b3951f17b3a1a Mon Sep 17 00:00:00 2001
From: Jay3332 <40323796+jay3332@users.noreply.github.com>
Date: Mon, 18 Mar 2024 19:56:30 -0400
Subject: [PATCH 6/7] fix links in changelog
---
CHANGELOG.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a8eec6909..8f5c3485a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,8 +9,8 @@ Versions prior to v0.7 are not tagged/released on GitHub.
- Add `PngEncoderOptions::new`
### Bug fixes
-- Fix text alignment rendering duplicately ([#28])
-- Fix `TextLayout`s with varying fonts not registering properly ([#29])
+- Fix text alignment rendering duplicately ([#28](https://github.com/jay3332/ril/issues/28))
+- Fix `TextLayout`s with varying fonts not registering properly ([#29](https://github.com/jay3332/ril/issues/29))
## v0.10.1 (2023-10-14)
From b9a750303c1068797ed3a8f22ff49c24af737dca Mon Sep 17 00:00:00 2001
From: Mehedi Hasan