[gtk+/parser: 4/66] label: we can't ignore sizes on ellipsized labels
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/parser: 4/66] label: we can't ignore sizes on ellipsized labels
- Date: Mon, 11 Apr 2011 22:29:29 +0000 (UTC)
commit f1831299e4918277b6fee2f94a58d302c9b8d859
Author: Benjamin Otte <otte redhat com>
Date: Sun Apr 3 15:03:19 2011 +0200
label: we can't ignore sizes on ellipsized labels
So don't use this optimization when a label is ellipsized.
https://bugzilla.gnome.org/show_bug.cgi?id=646517
gtk/gtklabel.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index fe86ea8..5513161 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3078,12 +3078,14 @@ gtk_label_get_measuring_layout (GtkLabel * label,
}
/* oftentimes we want to measure a width that is far wider than the current width,
- * even though the layout is not wrapped. In that case, we can just return the
- * current layout, because for measuring purposes, it will be identical.
+ * even though the layout would not change if we made it wider. In that case, we
+ * can just return the current layout, because for measuring purposes, it will be
+ * identical.
*/
pango_layout_get_extents (priv->layout, NULL, &rect);
if ((width == -1 || rect.width <= width) &&
- !pango_layout_is_wrapped (priv->layout))
+ !pango_layout_is_wrapped (priv->layout) &&
+ !pango_layout_is_ellipsized (priv->layout))
{
g_object_ref (priv->layout);
return priv->layout;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]