Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Improve mypaint chip icon

manongjohn1b11831f1e77
diff --git a/toonz/sources/toonzlib/mypaintbrushstyle.cpp b/toonz/sources/toonzlib/mypaintbrushstyle.cpp
index b9423834e..21820a1b8 100644
--- a/toonz/sources/toonzlib/mypaintbrushstyle.cpp
+++ b/toonz/sources/toonzlib/mypaintbrushstyle.cpp
@@ -289,11 +289,15 @@ void TMyPaintBrushStyle::makeIcon(const TDimension &d) {
double sx = (double)d.lx / (double)m_preview->getLx();
double sy = (double)d.ly / (double)m_preview->getLy();
double scale = std::min(sx, sy);
- TRop::quickPut(m_icon, m_preview, TScale(scale));
+ TRaster32P resamplePreview(m_preview->getLx(), m_preview->getLy());
+ TRop::resample(resamplePreview, m_preview, TScale(scale),
+ TRop::ResampleFilterType::Hamming3);
+ TRop::over(m_icon, resamplePreview);
}
// paint color marker
- if (d.lx > 0 && d.ly > 0) {
+ // Only show color marker when the icon size is 22x22
+ if (d.lx == d.ly && d.lx <= 22) {
int size = std::min(1 + std::min(d.lx, d.ly) * 2 / 3,
1 + std::max(d.lx, d.ly) / 2);
TPixel32 color = getMainColor();