mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +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.
|
||||
if (sprite->width() <= image->width() ||
|
||||
sprite->height() <= image->height()) {
|
||||
// TODO review this (I think limits are wrong and high limit can
|
||||
// be negative here)
|
||||
x = std::clamp(x, 0, sprite->width() - image->width());
|
||||
y = std::clamp(y, 0, sprite->height() - image->height());
|
||||
x = std::clamp(x, 0, image->width() - sprite->width());
|
||||
y = std::clamp(y, 0, image->height() - sprite->height());
|
||||
}
|
||||
else {
|
||||
// Also we always limit the 1 image pixel inside the sprite's bounds.
|
||||
|
Loading…
Reference in New Issue
Block a user