Skip to content

Commit

Permalink
Minor formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Apr 22, 2020
1 parent 3c1ea2f commit 3b370c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/doc/algorithm/shift_image.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/doc/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 8 additions & 3 deletions src/doc/mask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 3b370c2

Please sign in to comment.