summaryrefslogtreecommitdiff
path: root/gtk/gtkpreview.c
diff options
context:
space:
mode:
authorTim Janik <timj@gimp.org>1998-02-28 14:35:55 +0000
committerTim Janik <timj@src.gnome.org>1998-02-28 14:35:55 +0000
commit8a19c2a157b3d30d583dece682ad464b743852ff (patch)
tree5f6e9d70425205f1ded866c2ffe94336b6a4967e /gtk/gtkpreview.c
parent7ad17f7b08176dcc2f33c276a71791a08968a0a4 (diff)
downloadgdk-pixbuf-8a19c2a157b3d30d583dece682ad464b743852ff.tar.gz
fix behavior of gtk_preview_put() with srcx/srcy != 0,
Sat Feb 28 15:18:36 1998 Tim Janik <timj@gimp.org> * gtk/gtkpreview.c: fix behavior of gtk_preview_put() with srcx/srcy != 0, gtk-shige-980127-0.patch.gz by AOSASA Shigeru <aozasa@sakuranet.or.jp>. * gdk: applied gtk-roebling-980121-0.patch.gz, patch for region support in Gdk, by Robert Roebling <roebling@ruf.uni-freiburg.de>.
Diffstat (limited to 'gtk/gtkpreview.c')
-rw-r--r--gtk/gtkpreview.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c
index 269c9fe70..1af2e73d9 100644
--- a/gtk/gtkpreview.c
+++ b/gtk/gtkpreview.c
@@ -312,13 +312,13 @@ gtk_preview_put (GtkPreview *preview,
widget = GTK_WIDGET (preview);
- r1.x = srcx;
- r1.y = srcy;
+ r1.x = 0;
+ r1.y = 0;
r1.width = preview->buffer_width;
r1.height = preview->buffer_height;
- r2.x = destx;
- r2.y = desty;
+ r2.x = srcx;
+ r2.y = srcy;
r2.width = width;
r2.height = height;
@@ -418,7 +418,9 @@ gtk_preview_put (GtkPreview *preview,
}
gdk_draw_image (window, gc,
- image, 0, 0, x, y,
+ image, 0, 0,
+ destx + (r3.x - srcx) + (x - r3.x),
+ desty + (r3.y - srcy) + (y - r3.y),
xe - x, ye - y);
gdk_flush ();
}
@@ -693,15 +695,17 @@ gtk_preview_expose (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
preview = GTK_PREVIEW (widget);
-
+
gtk_preview_put (GTK_PREVIEW (widget),
widget->window, widget->style->black_gc,
- (widget->allocation.width - preview->buffer_width) / 2,
- (widget->allocation.height - preview->buffer_height) / 2,
+ event->area.x -
+ (widget->allocation.width - preview->buffer_width)/2,
+ event->area.y -
+ (widget->allocation.height - preview->buffer_height)/2,
event->area.x, event->area.y,
event->area.width, event->area.height);
}
-
+
return FALSE;
}