From 7507c2e4eb5649b0f08c787b120820e8f379ebc7 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 4 Feb 2020 12:51:02 -0300 Subject: [PATCH] Minor change in BrushLockAlphaInkProcessing::processPixel() We can use m_transparentColor directly (as in other inks) and ask for the transparent color before pre-processing the pixel if it's not needed. --- src/app/tools/ink_processing.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/tools/ink_processing.h b/src/app/tools/ink_processing.h index 10d232ab8..641f3ec9f 100644 --- a/src/app/tools/ink_processing.h +++ b/src/app/tools/ink_processing.h @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019 Igara Studio S.A. +// Copyright (C) 2019-2020 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -1141,8 +1141,6 @@ public: // Do nothing } - color_t getTransparentColor() { return m_transparentColor; } - protected: void alignPixelPoint(int& x, int& y) { x = (x - m_u) % m_width; @@ -1368,10 +1366,11 @@ void BrushLockAlphaInkProcessing::processPixel(int x, int y) { template<> void BrushLockAlphaInkProcessing::processPixel(int x, int y) { - color_t c; - if (preProcessPixel(x, y, &c)) - if (*m_srcAddress != getTransparentColor()) + if (*m_srcAddress != m_transparentColor) { + color_t c; + if (preProcessPixel(x, y, &c)) *m_dstAddress = c; + } } template<>