Bug 730071 - Selection bounds miscalculated for multiples of 128

gimp_gegl_mask_bounds(): when we succeed avoiding iterating a tile by
checking its upper-left and bottom-right, use the function's internal
meaning of x2, y2, which is the rightmost/bottommost selected pixel,
while the external meaning is the pixel right/below it.
 Short: use "foo - 1" not "foo".
This commit is contained in:
Michael Natterer
2014-05-13 21:41:17 +02:00
parent a91007756c
commit 2acbf8a70f

View File

@ -70,11 +70,16 @@ gimp_gegl_mask_bounds (GeglBuffer *buffer,
*/
if (data[0] && data[iter->length - 1])
{
/* "ex/ey - 1" because the internal variables are the
* right/bottom pixel of the mask's contents, not one
* right/below it like the return values.
*/
if (roi->x < tx1) tx1 = roi->x;
if (ex > tx2) tx2 = ex;
if (ex > tx2) tx2 = ex - 1;
if (roi->y < ty1) ty1 = roi->y;
if (ey > ty2) ty2 = ey;
if (ey > ty2) ty2 = ey - 1;
}
else
{