mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +00:00
Fix clamp limit to avoid assertion in debug mode on visual studio on windows
This commit is contained in:
parent
20902e35b8
commit
04e095bbd5
@ -2624,10 +2624,8 @@ void Editor::pasteImage(const Image* image, const Mask* mask)
|
|||||||
// Limit the image inside the sprite's bounds.
|
// Limit the image inside the sprite's bounds.
|
||||||
if (sprite->width() <= image->width() ||
|
if (sprite->width() <= image->width() ||
|
||||||
sprite->height() <= image->height()) {
|
sprite->height() <= image->height()) {
|
||||||
// TODO review this (I think limits are wrong and high limit can
|
x = std::clamp(x, 0, image->width() - sprite->width());
|
||||||
// be negative here)
|
y = std::clamp(y, 0, image->height() - sprite->height());
|
||||||
x = std::clamp(x, 0, sprite->width() - image->width());
|
|
||||||
y = std::clamp(y, 0, sprite->height() - image->height());
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Also we always limit the 1 image pixel inside the sprite's bounds.
|
// Also we always limit the 1 image pixel inside the sprite's bounds.
|
||||||
|
Loading…
Reference in New Issue
Block a user