Minor formatting changes

This commit is contained in:
David Capello 2020-04-22 20:20:04 -03:00
parent 3c1ea2f407
commit 3b370c2ff5
3 changed files with 11 additions and 6 deletions

View File

@ -1,5 +1,5 @@
// Aseprite Document Library
// Copyright (c) 2019 Igara Studio S.A.
// Copyright (c) 2019-2020 Igara Studio S.A.
// Copyright (c) 2001-2018 David Capello
//
// This file is released under the terms of the MIT license.
@ -46,7 +46,7 @@ void shift_image(Image* image, int dx, int dy, double angle)
// To simplify the algorithm we use a copy of the original image, we
// could avoid this copy swapping rows and columns.
ImageRef crop(crop_image(image, bounds.x, bounds.y, bounds.w, bounds.h,
image->maskColor()));
image->maskColor()));
for (int y=0; y<bounds.h; ++y) {
for (int x=0; x<bounds.w; ++x) {

View File

@ -74,7 +74,7 @@ Image* Image::createCopy(const Image* image, const ImageBufferPtr& buffer)
{
ASSERT(image);
return crop_image(image, 0, 0, image->width(), image->height(),
image->maskColor(), buffer);
image->maskColor(), buffer);
}
} // namespace doc

View File

@ -233,7 +233,8 @@ void Mask::intersect(const gfx::Rect& bounds)
Image* image = NULL;
if (!newBounds.isEmpty()) {
image = crop_image(m_bitmap.get(),
image = crop_image(
m_bitmap.get(),
newBounds.x-m_bounds.x,
newBounds.y-m_bounds.y,
newBounds.w,
@ -429,7 +430,8 @@ void Mask::reserve(const gfx::Rect& bounds)
gfx::Rect newBounds = m_bounds.createUnion(bounds);
if (m_bounds != newBounds) {
Image* image = crop_image(m_bitmap.get(),
Image* image = crop_image(
m_bitmap.get(),
newBounds.x-m_bounds.x,
newBounds.y-m_bounds.y,
newBounds.w,
@ -493,7 +495,10 @@ void Mask::shrink()
m_bounds.w = x2 - x1 + 1;
m_bounds.h = y2 - y1 + 1;
Image* image = crop_image(m_bitmap.get(), m_bounds.x-u, m_bounds.y-v, m_bounds.w, m_bounds.h, 0);
Image* image = crop_image(
m_bitmap.get(),
m_bounds.x-u, m_bounds.y-v,
m_bounds.w, m_bounds.h, 0);
m_bitmap.reset(image);
}