Merge pull request #1156 from manongjohn/fix_smart_raster_lockalpha_tone
Fix Smart Raster Brush Lock Alpha Tone
This commit is contained in:
commit
cebc72e6bd
3 changed files with 13 additions and 5 deletions
|
@ -52,9 +52,13 @@ void putOnRasterCM(const TRasterCM32P &out, const TRaster32P &in, int styleId,
|
|||
continue;
|
||||
}
|
||||
bool sameStyleId = styleId == outPix->getInk();
|
||||
// line with lock alpha : use original pixel's tone
|
||||
// line with the same style : multiply tones
|
||||
// line with different style : pick darker tone
|
||||
int tone = sameStyleId ? outPix->getTone() * (255 - inPix->m) / 255
|
||||
int tone = lockAlpha
|
||||
? outPix->getTone()
|
||||
: sameStyleId
|
||||
? outPix->getTone() * (255 - inPix->m) / 255
|
||||
: std::min(255 - inPix->m, outPix->getTone());
|
||||
int ink = !sameStyleId && outPix->getTone() < 255 - inPix->m
|
||||
? outPix->getInk()
|
||||
|
|
|
@ -34,9 +34,12 @@ void putOnRasterCM(const TRasterCM32P &out, const TRaster32P &in, int styleId,
|
|||
continue;
|
||||
}
|
||||
bool sameStyleId = styleId == outPix->getInk();
|
||||
// line with lock alpha : use original pixel's tone
|
||||
// line with the same style : multiply tones
|
||||
// line with different style : pick darker tone
|
||||
int tone = sameStyleId ? outPix->getTone() * (255 - inPix->m) / 255
|
||||
int tone = lockAlpha ? outPix->getTone()
|
||||
: sameStyleId
|
||||
? outPix->getTone() * (255 - inPix->m) / 255
|
||||
: std::min(255 - inPix->m, outPix->getTone());
|
||||
int ink = !sameStyleId && outPix->getTone() < 255 - inPix->m
|
||||
? outPix->getInk()
|
||||
|
|
|
@ -234,7 +234,8 @@ void RasterStrokeGenerator::placeOver(const TRasterCM32P &out,
|
|||
}
|
||||
}
|
||||
if (inTone <= outTone) {
|
||||
*outPix = TPixelCM32(inPix->getInk(), outPix->getPaint(), inTone);
|
||||
*outPix = TPixelCM32(inPix->getInk(), outPix->getPaint(),
|
||||
m_modifierLockAlpha ? outTone : inTone);
|
||||
}
|
||||
}
|
||||
if (m_task == ERASE) {
|
||||
|
|
Loading…
Reference in a new issue