[pango/wip/baedert/for-master2: 1/17] layout: Ignore setting the width if it won't have any effect
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/wip/baedert/for-master2: 1/17] layout: Ignore setting the width if it won't have any effect
- Date: Mon, 8 Jun 2020 17:21:11 +0000 (UTC)
commit b0c9b985cba225351e884786a08a321b030413c3
Author: Timm Bäder <mail baedert org>
Date: Tue Apr 14 10:09:20 2020 +0200
layout: Ignore setting the width if it won't have any effect
This is a pretty weak check (think e.g. a layout containing the text
"a\na"), but it's very easy to do and still hits quite a few cases in
real-world applications.
pango/pango-layout.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 44d59367..872ccd71 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -362,6 +362,11 @@ pango_layout_set_width (PangoLayout *layout,
if (width != layout->width)
{
layout->width = width;
+
+ /* Increasing the width can only decrease the line count */
+ if (layout->line_count == 1 && width > layout->width)
+ return;
+
layout_changed (layout);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]