Skip to content

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

C

handle #0 fill better

Abel You26b8b4df86ff
diff --git a/toonz/sources/toonzlib/fill.cpp b/toonz/sources/toonzlib/fill.cpp
index 3db57b885..cd0b0b727 100644
--- a/toonz/sources/toonzlib/fill.cpp
+++ b/toonz/sources/toonzlib/fill.cpp
@@ -555,6 +555,16 @@ bool fill(const TRasterCM32P &r, const FillParameters &params,
/*- Return if clicked outside the screen -*/
if (!bbbox.contains(p)) return false;
+
+ if (paint == 0) {
+ FillParameters tmp = FillParameters(params);
+ tmp.m_styleId = TPixelCM32::getMaxPaint() - 1;
+ tmp.m_palette = 0;
+ fill(r, tmp, saver, Ref);
+ std::vector<int> a = { TPixelCM32::getMaxPaint() - 1 };
+ TRop::eraseColors(r, &a, false);
+ return true;
+ }
/*- If the same color has already been painted, return -*/
pix0 = r->pixels(p.y) + p.x;