gimp r27642 - in trunk: . app/display
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27642 - in trunk: . app/display
- Date: Thu, 13 Nov 2008 23:12:56 +0000 (UTC)
Author: neo
Date: Thu Nov 13 23:12:56 2008
New Revision: 27642
URL: http://svn.gnome.org/viewvc/gimp?rev=27642&view=rev
Log:
2008-11-14 Sven Neumann <sven gimp org>
* app/display/gimpdisplayshell-preview.c
(gimp_display_shell_draw_quad): check that the resulting area
has
positive width and height.
Modified:
trunk/ChangeLog
trunk/app/display/gimpdisplayshell-preview.c
Modified: trunk/app/display/gimpdisplayshell-preview.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-preview.c (original)
+++ trunk/app/display/gimpdisplayshell-preview.c Thu Nov 13 23:12:56 2008
@@ -350,14 +350,13 @@
gfloat *v,
guchar opacity)
{
- gint x2[3], y2[3];
- gfloat u2[3], v2[3];
- gint minx, maxx, miny, maxy; /* screen bounds of the quad */
- gint dwidth, dheight; /* dimensions of dest */
- GdkPixbuf *area; /* quad sized area with dest pixels */
- gint c;
+ gint x2[3], y2[3];
+ gfloat u2[3], v2[3];
+ gint minx, maxx, miny, maxy; /* screen bounds of the quad */
+ gint dwidth, dheight; /* dimensions of dest */
+ gint c;
- g_return_if_fail(GDK_IS_DRAWABLE (dest));
+ g_return_if_fail (GDK_IS_DRAWABLE (dest));
x2[0] = x[3]; y2[0] = y[3]; u2[0] = u[3]; v2[0] = v[3];
x2[1] = x[2]; y2[1] = y[2]; u2[1] = u[2]; v2[1] = v[2];
@@ -383,21 +382,27 @@
}
if (minx < 0) minx = 0;
if (miny < 0) miny = 0;
- if (maxx > dwidth - 1) maxx=dwidth - 1;
- if (maxy > dheight - 1) maxy=dheight - 1;
+ if (maxx > dwidth - 1) maxx = dwidth - 1;
+ if (maxy > dheight - 1) maxy = dheight - 1;
+
+ if (minx <= maxx && miny <= maxy)
+ {
+ GdkPixbuf *area;
- area = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
- maxx - minx + 1, maxy - miny + 1);
- g_return_if_fail (area != NULL);
-
- gimp_display_shell_draw_tri (texture, dest, area, minx, miny,
- mask, mask_offx, mask_offy,
- x, y, u, v, opacity);
- gimp_display_shell_draw_tri (texture, dest, area, minx, miny,
- mask, mask_offx, mask_offy,
- x2, y2, u2, v2, opacity);
+ area = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
+ maxx - minx + 1, maxy - miny + 1);
- g_object_unref (area);
+ g_return_if_fail (area != NULL);
+
+ gimp_display_shell_draw_tri (texture, dest, area, minx, miny,
+ mask, mask_offx, mask_offy,
+ x, y, u, v, opacity);
+ gimp_display_shell_draw_tri (texture, dest, area, minx, miny,
+ mask, mask_offx, mask_offy,
+ x2, y2, u2, v2, opacity);
+
+ g_object_unref (area);
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]