mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-04 06:40:07 +00:00
Fix problems because excessive zoom out
* Crash when the checked background is too small * Infinite loop to draw the grid
This commit is contained in:
parent
adf08ac7df
commit
5c9c05ebe7
@ -666,6 +666,8 @@ void Editor::drawGrid(Graphics* g, const gfx::Rect& spriteBounds, const Rect& gr
|
|||||||
|
|
||||||
// Convert the "grid" rectangle to screen coordinates
|
// Convert the "grid" rectangle to screen coordinates
|
||||||
grid = editorToScreen(grid);
|
grid = editorToScreen(grid);
|
||||||
|
if (grid.w < 1 || grid.h < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
// Adjust for client area
|
// Adjust for client area
|
||||||
gfx::Rect bounds = getBounds();
|
gfx::Rect bounds = getBounds();
|
||||||
|
@ -613,6 +613,9 @@ void RenderEngine::renderCheckedBackground(Image* image,
|
|||||||
if (tile_w < zoom.apply(1)) tile_w = zoom.apply(1);
|
if (tile_w < zoom.apply(1)) tile_w = zoom.apply(1);
|
||||||
if (tile_h < zoom.apply(1)) tile_h = zoom.apply(1);
|
if (tile_h < zoom.apply(1)) tile_h = zoom.apply(1);
|
||||||
|
|
||||||
|
if (tile_w < 1) tile_w = 1;
|
||||||
|
if (tile_h < 1) tile_h = 1;
|
||||||
|
|
||||||
// Tile position (u,v) is the number of tile we start in (source_x,source_y) coordinate
|
// Tile position (u,v) is the number of tile we start in (source_x,source_y) coordinate
|
||||||
u = (source_x / tile_w);
|
u = (source_x / tile_w);
|
||||||
v = (source_y / tile_h);
|
v = (source_y / tile_h);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user