mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 04:20:23 +00:00
Fixed size calculation on resize_image
This commit is contained in:
parent
26279597b6
commit
b65fb3a14e
@ -21,6 +21,7 @@
|
||||
#include "doc/sprite.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
|
||||
namespace app {
|
||||
@ -33,8 +34,8 @@ doc::Image* resize_image(
|
||||
const RgbMap* rgbmap)
|
||||
{
|
||||
doc::ImageSpec spec = image->spec();
|
||||
spec.setWidth(std::max(1, int(scale.w*image->width())));
|
||||
spec.setHeight(std::max(1, int(scale.h*image->height())));
|
||||
spec.setWidth(std::max(1, int(std::round(scale.w*image->width()))));
|
||||
spec.setHeight(std::max(1, int(std::round(scale.h*image->height()))));
|
||||
std::unique_ptr<doc::Image> newImage(
|
||||
doc::Image::create(spec));
|
||||
newImage->setMaskColor(image->maskColor());
|
||||
|
Loading…
x
Reference in New Issue
Block a user