OpenToonz - An open-source full-featured 2D animation creation software
C
Do not prevailing two different INK in fillRow()
Abel You1897d0cc2f6d
diff --git a/toonz/sources/toonzlib/fill.cpp b/toonz/sources/toonzlib/fill.cppindex 996bf9ad3..431d575ec 100644--- a/toonz/sources/toonzlib/fill.cpp+++ b/toonz/sources/toonzlib/fill.cpp@@ -90,6 +90,8 @@ void fillRow(const TRasterCM32P &r, const TPoint &p, int &xa, int &xb,if (prevailing && tone == 0) {tmp_limit = pix + 10; // edge stop fill == 10 per defaultif (limit > tmp_limit) limit = tmp_limit;+ int preVailingInk,+ oldPrevailingInk = 0; // avoid prevailing different Ink stylesfor (; pix <= limit; pix++) {if (refImagePut && !USE_PREVAILING_REFER_FILL &&pix->getInk() == TPixelCM32::getMaxInk() &&@@ -98,8 +100,13 @@ void fillRow(const TRasterCM32P &r, const TPoint &p, int &xa, int &xb,if (DEF_REGION_WITH_PAINT && pix->getPaint() != paintAtClickPos) break;if (pix->getPaint() == paint) break;if (pix->getTone() != 0) break;+ if (prevailing) {+ preVailingInk = pix->getInk();+ if (oldPrevailingInk > 0 && preVailingInk != oldPrevailingInk) break;+ oldPrevailingInk = preVailingInk;}}+ }xb = p.x + pix - pix0 - 1;@@ -146,6 +153,7 @@ void fillRow(const TRasterCM32P &r, const TPoint &p, int &xa, int &xb,if (prevailing && tone == 0) {tmp_limit = pix - 10;if (limit < tmp_limit) limit = tmp_limit;+ int preVailingInk, oldPrevailingInk = 0;for (; pix >= limit; pix--) {if (refImagePut && !USE_PREVAILING_REFER_FILL &&pix->getInk() == TPixelCM32::getMaxInk() &&@@ -154,8 +162,13 @@ void fillRow(const TRasterCM32P &r, const TPoint &p, int &xa, int &xb,if (DEF_REGION_WITH_PAINT && pix->getPaint() != paintAtClickPos) break;if (pix->getPaint() == paint) break;if (pix->getTone() != 0) break;+ if (prevailing) {+ preVailingInk = pix->getInk();+ if (oldPrevailingInk > 0 && preVailingInk != oldPrevailingInk) break;+ oldPrevailingInk = preVailingInk;}}+ }xa = p.x + pix - pix0 + 1;@@ -165,8 +178,7 @@ void fillRow(const TRasterCM32P &r, const TPoint &p, int &xa, int &xb,pix = line + xa;int n;for (n = 0; n < xb - xa + 1; n++, pix++) {- if (palette) {- if (pix->isPurePaint()) {+ if (palette && pix->isPurePaint()) {TPoint pInk = nearestInkNotDiagonal(r, TPoint(xa + n, p.y));if (pInk != TPoint(-1, -1)) {TPixelCM32 *pixInk = (TPixelCM32 *)r->getRawData() +@@ -178,7 +190,6 @@ void fillRow(const TRasterCM32P &r, const TPoint &p, int &xa, int &xb,inkFill(r, pInk, paint, 0, saver);}}- }if (refImagePut && pix->getInk() == TPixelCM32::getMaxInk() &&!DEF_REGION_WITH_PAINT)pix->setInk(paint);