summaryrefslogtreecommitdiff
path: root/gdk/gdkdraw.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2000-12-02 07:51:37 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-12-02 07:51:37 +0000
commit35876710dc133b5cab14241174ba0e680ca854af (patch)
treecab3760bbea08fdcb20e9a9a9f10f6eff3c00b07 /gdk/gdkdraw.c
parentfb14d1299e3b81a70938462f841f17ea1e217ded (diff)
downloadgdk-pixbuf-35876710dc133b5cab14241174ba0e680ca854af.tar.gz
don't create dangling pointers to the appearance attributes from the line
2000-11-30 Havoc Pennington <hp@pobox.com> * gtk/gtktextdisplay.c (gtk_text_layout_draw): don't create dangling pointers to the appearance attributes from the line display * gdk/gdkdraw.c (gdk_drawable_get_image): allow negative width/height to mean "full width/height of drawable" * gtk/gtktextview.h, gtk/gtktextview.c: Implement double/triple click to select word/line * gtk/gtktextiter.c (test_log_attrs): include paragraph delimiters when getting log attrs. Get a slice, so that pixmaps and stuff are properly handled. * gtk/gtktextbuffer.c (paste): Fix pasting to work properly if you paste into the selection (replaces selection now, previously crashed or added to selection). Reveals longstanding btree bug - select multiple lines, middle-click on the selection, boom. This isn't related to my changes though. * gtk/gtkentry.c (gtk_entry_move_forward_word): Update to reflect PangoLogAttrs changes (gtk_entry_move_backward_word): ditto * gtk/gtktextlayout.h, gtk/gtktextlayout.c: Make the iter motion functions return bool whether the iter moved onto a dereferenceable position. * gtk/gtktextview.h, gtk/gtktextview.c: Add a bunch of public functions for motion in terms of display lines. * gtk/gtktextmark.c (gtk_text_mark_get_buffer): Add function to get the buffer a mark is inside
Diffstat (limited to 'gdk/gdkdraw.c')
-rw-r--r--gdk/gdkdraw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index facc185e9..fcab539e5 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -486,9 +486,12 @@ gdk_drawable_get_image (GdkDrawable *drawable,
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (x >= 0, NULL);
g_return_val_if_fail (y >= 0, NULL);
- g_return_val_if_fail (width >= 0, NULL);
- g_return_val_if_fail (height >= 0, NULL);
+ if (width < 0 || height < 0)
+ gdk_drawable_get_size (drawable,
+ width < 0 ? &width : NULL,
+ height < 0 ? &height : NULL);
+
composite =
GDK_DRAWABLE_GET_CLASS (drawable)->get_composite_drawable (drawable,
x, y,