mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
Fixed issue regarding when color index of a pixel is bigger than the palette size
This commit is contained in:
parent
013792a215
commit
3da532453c
@ -110,12 +110,14 @@ public:
|
||||
template<>
|
||||
class BlenderHelper<IndexedTraits, IndexedTraits> {
|
||||
BlendMode m_blendMode;
|
||||
color_t m_mask_color;
|
||||
color_t m_maskColor;
|
||||
int m_paletteSize;
|
||||
public:
|
||||
BlenderHelper(const Image* src, const Palette* pal, BlendMode blendMode, const bool newBlend)
|
||||
{
|
||||
m_blendMode = blendMode;
|
||||
m_mask_color = src->maskColor();
|
||||
m_maskColor = src->maskColor();
|
||||
m_paletteSize = pal->size();
|
||||
}
|
||||
inline IndexedTraits::pixel_t
|
||||
operator()(const IndexedTraits::pixel_t& dst,
|
||||
@ -126,13 +128,13 @@ public:
|
||||
return src;
|
||||
}
|
||||
else if (m_blendMode == BlendMode::DST_OVER) {
|
||||
if (dst != m_mask_color)
|
||||
if (dst != m_maskColor)
|
||||
return dst;
|
||||
else
|
||||
return src;
|
||||
}
|
||||
else {
|
||||
if (src != m_mask_color)
|
||||
if (src != m_maskColor && src < m_paletteSize)
|
||||
return src;
|
||||
else
|
||||
return dst;
|
||||
|
Loading…
Reference in New Issue
Block a user