mirror of https://github.com/aseprite/aseprite.git
Minor formatting changes
This commit is contained in:
parent
3c1ea2f407
commit
3b370c2ff5
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite Document Library
|
// Aseprite Document Library
|
||||||
// Copyright (c) 2019 Igara Studio S.A.
|
// Copyright (c) 2019-2020 Igara Studio S.A.
|
||||||
// Copyright (c) 2001-2018 David Capello
|
// Copyright (c) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// 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
|
// To simplify the algorithm we use a copy of the original image, we
|
||||||
// could avoid this copy swapping rows and columns.
|
// could avoid this copy swapping rows and columns.
|
||||||
ImageRef crop(crop_image(image, bounds.x, bounds.y, bounds.w, bounds.h,
|
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 y=0; y<bounds.h; ++y) {
|
||||||
for (int x=0; x<bounds.w; ++x) {
|
for (int x=0; x<bounds.w; ++x) {
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ Image* Image::createCopy(const Image* image, const ImageBufferPtr& buffer)
|
||||||
{
|
{
|
||||||
ASSERT(image);
|
ASSERT(image);
|
||||||
return crop_image(image, 0, 0, image->width(), image->height(),
|
return crop_image(image, 0, 0, image->width(), image->height(),
|
||||||
image->maskColor(), buffer);
|
image->maskColor(), buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace doc
|
} // namespace doc
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,8 @@ void Mask::intersect(const gfx::Rect& bounds)
|
||||||
Image* image = NULL;
|
Image* image = NULL;
|
||||||
|
|
||||||
if (!newBounds.isEmpty()) {
|
if (!newBounds.isEmpty()) {
|
||||||
image = crop_image(m_bitmap.get(),
|
image = crop_image(
|
||||||
|
m_bitmap.get(),
|
||||||
newBounds.x-m_bounds.x,
|
newBounds.x-m_bounds.x,
|
||||||
newBounds.y-m_bounds.y,
|
newBounds.y-m_bounds.y,
|
||||||
newBounds.w,
|
newBounds.w,
|
||||||
|
|
@ -429,7 +430,8 @@ void Mask::reserve(const gfx::Rect& bounds)
|
||||||
gfx::Rect newBounds = m_bounds.createUnion(bounds);
|
gfx::Rect newBounds = m_bounds.createUnion(bounds);
|
||||||
|
|
||||||
if (m_bounds != newBounds) {
|
if (m_bounds != newBounds) {
|
||||||
Image* image = crop_image(m_bitmap.get(),
|
Image* image = crop_image(
|
||||||
|
m_bitmap.get(),
|
||||||
newBounds.x-m_bounds.x,
|
newBounds.x-m_bounds.x,
|
||||||
newBounds.y-m_bounds.y,
|
newBounds.y-m_bounds.y,
|
||||||
newBounds.w,
|
newBounds.w,
|
||||||
|
|
@ -493,7 +495,10 @@ void Mask::shrink()
|
||||||
m_bounds.w = x2 - x1 + 1;
|
m_bounds.w = x2 - x1 + 1;
|
||||||
m_bounds.h = y2 - y1 + 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);
|
m_bitmap.reset(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue