[gtk+] label: Fix another sizing corner case causing segfaults
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] label: Fix another sizing corner case causing segfaults
- Date: Thu, 8 Nov 2012 22:45:31 +0000 (UTC)
commit 0d9a45d46006cf03afc1868130005736cf5a2d0c
Author: Benjamin Otte <otte redhat com>
Date: Thu Nov 8 23:15:19 2012 +0100
label: Fix another sizing corner case causing segfaults
If the "wider" label is the smaller one, use the wider size for both
cases. This can happen when ellipsizing a single character, which is
often smaller than the ellipsizing glpyph(s).
gtk/gtklabel.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index a3c9283..92f55b6 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3557,7 +3557,8 @@ gtk_label_get_preferred_layout_size (GtkLabel *label,
*smallest = *widest;
}
- g_assert (widest->width >= smallest->width);
+ if (widest->width < smallest->width)
+ *smallest = *widest;
g_object_unref (layout);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]