[pango/matthiasc/for-master: 3/5] layout: Fix a small optimization
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/matthiasc/for-master: 3/5] layout: Fix a small optimization
- Date: Fri, 16 Apr 2021 18:37:28 +0000 (UTC)
commit 728c2894b253d28313974c5199e71a357349af31
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 4 11:49:10 2021 -0400
layout: Fix a small optimization
pango_layout_set_width was trying to avoid invalidating
lines in some cases, but it failed.
pango/pango-layout.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index fa499ef3..baeed3ce 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -355,10 +355,12 @@ pango_layout_set_width (PangoLayout *layout,
if (width != layout->width)
{
+ int old_width = layout->width;
+
layout->width = width;
/* Increasing the width can only decrease the line count */
- if (layout->line_count == 1 && width > layout->width)
+ if (layout->line_count == 1 && width > old_width)
return;
layout_changed (layout);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]