bug 110804 gdk exits during print preview

move the test for invalid size (off screen pixels) to point after last time sizes are set
r=yokoyama@netscape.com, sr=waterson@netscape.com
This commit is contained in:
bstell%netscape.com 2001-11-27 23:02:26 +00:00
parent 56f7fc2275
commit f706ed0c13

View File

@ -395,8 +395,6 @@ nsX11AlphaBlend::GetBackground(Display *aDisplay, int aScreen,
}
PRInt32 copy_width = aWidth - x_skip;
PRInt32 copy_height = aHeight - y_skip;
if ((copy_width<=0) || (copy_height<=0))
return nsnull; // nothing visible
Window root;
int win_x, win_y;
@ -426,6 +424,8 @@ nsX11AlphaBlend::GetBackground(Display *aDisplay, int aScreen,
copy_height = MIN(copy_height, (int)root_win_height - (aY+y_skip));
any_offscreen = PR_TRUE;
}
if ((copy_width<=0) || (copy_height<=0))
return nsnull; // nothing visible
// get the background image
// if any part is off screen XGetImage will fail, so we XCreateImage