mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-04 05:50:15 +00:00
Fix #473: Now paint bucket-like tools stop at grid bounds
This commit is contained in:
parent
190306b127
commit
9346ee0f48
@ -96,6 +96,23 @@ private:
|
||||
|
||||
bounds = bounds.createIntersect(loop->getSrcImage()->bounds());
|
||||
|
||||
// Limit the flood-fill to the current tile if the grid is visible.
|
||||
if (loop->getDocumentSettings()->getGridVisible()) {
|
||||
gfx::Rect grid = loop->getDocumentSettings()->getGridBounds();
|
||||
div_t d, dx, dy;
|
||||
|
||||
dx = div(grid.x+loop->getOffset().x, grid.w);
|
||||
dy = div(grid.y+loop->getOffset().y, grid.h);
|
||||
|
||||
d = div(x-dx.rem, grid.w);
|
||||
x = dx.rem + d.quot*grid.w;
|
||||
|
||||
d = div(y-dy.rem, grid.h);
|
||||
y = dy.rem + d.quot*grid.h;
|
||||
|
||||
bounds = bounds.createIntersect(gfx::Rect(x, y, grid.w, grid.h));
|
||||
}
|
||||
|
||||
return bounds;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user