[gtk] textlayout: Allow querying empty areas
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] textlayout: Allow querying empty areas
- Date: Fri, 29 Mar 2019 08:59:48 +0000 (UTC)
commit 4b07d2815375856823532b2238d87455c3be2f7c
Author: Benjamin Otte <otte redhat com>
Date: Fri Mar 29 00:24:00 2019 +0100
textlayout: Allow querying empty areas
This only happens when the textview has no content, but it does happen
now that such a textview gets allocated 0x0 and not 1x1.
gtk/gtktextlayout.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index 51ac51a3b6..7947eadcf8 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -722,7 +722,9 @@ gtk_text_layout_get_lines (GtkTextLayout *layout,
GSList *retval;
g_return_val_if_fail (GTK_IS_TEXT_LAYOUT (layout), NULL);
- g_return_val_if_fail (bottom_y > top_y, NULL);
+
+ if (top_y <= bottom_y)
+ return NULL;
retval = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]