1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
--- opencv-1.0.0.orig/otherlibs/highgui/window_gtk.cpp
+++ opencv-1.0.0/otherlibs/highgui/window_gtk.cpp
@@ -333,8 +333,10 @@
GDK_RGB_DITHER_MAX, image_widget->scaled_image->data.ptr, image_widget->scaled_image->step );
}
else if( image_widget->original_image ){
- gdk_draw_rgb_image( widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
- 0, 0, widget->allocation.width, widget->allocation.height,
+ gdk_draw_rgb_image( widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
+ 0, 0,
+ MIN(image_widget->original_image->cols, widget->allocation.width),
+ MIN(image_widget->original_image->rows, widget->allocation.height),
GDK_RGB_DITHER_MAX, image_widget->original_image->data.ptr, image_widget->original_image->step );
}
return TRUE;
|