mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 03:44:16 +00:00
Avoid crash when shift a tilemap pixels (still not working, but at doesn't crash)
This commit is contained in:
parent
ab4accb60d
commit
18759b1198
@ -12,12 +12,13 @@
|
|||||||
#include "doc/algorithm/shift_image.h"
|
#include "doc/algorithm/shift_image.h"
|
||||||
|
|
||||||
#include "base/pi.h"
|
#include "base/pi.h"
|
||||||
#include "gfx/rect.h"
|
|
||||||
#include "doc/algorithm/shrink_bounds.h"
|
#include "doc/algorithm/shrink_bounds.h"
|
||||||
#include "doc/cel.h"
|
#include "doc/cel.h"
|
||||||
#include "doc/image.h"
|
#include "doc/image.h"
|
||||||
|
#include "doc/layer.h"
|
||||||
#include "doc/mask.h"
|
#include "doc/mask.h"
|
||||||
#include "doc/primitives.h"
|
#include "doc/primitives.h"
|
||||||
|
#include "gfx/rect.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -106,10 +107,14 @@ ImageRef shift_image_with_mask(const Cel* cel,
|
|||||||
|
|
||||||
// Bounds and Image shrinking (we have to fit compound image (compImage) and bounds (compCelBounds))
|
// Bounds and Image shrinking (we have to fit compound image (compImage) and bounds (compCelBounds))
|
||||||
gfx::Rect newBounds = compImage->bounds();
|
gfx::Rect newBounds = compImage->bounds();
|
||||||
if (algorithm::shrink_bounds(compImage.get(),
|
if (algorithm::shrink_bounds(
|
||||||
compImage->maskColor(),
|
compImage.get(),
|
||||||
nullptr,
|
compImage->maskColor(),
|
||||||
newBounds)) {
|
// TODO adding the layer for tilemaps (so the program doesn't
|
||||||
|
// crash), but anyway it the Shift algorithm is not
|
||||||
|
// working yet for tilemaps
|
||||||
|
cel->layer(),
|
||||||
|
newBounds)) {
|
||||||
compCelBounds.offset(newBounds.x, newBounds.y);
|
compCelBounds.offset(newBounds.x, newBounds.y);
|
||||||
compCelBounds.setSize(newBounds.size());
|
compCelBounds.setSize(newBounds.size());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user