From 597034da8d849a87b87f1da55e690810885cae2d Mon Sep 17 00:00:00 2001 From: shun_iwasawa Date: Mar 03 2017 08:38:46 +0000 Subject: fix vector fill --- diff --git a/toonz/sources/common/tvectorimage/tcomputeregions.cpp b/toonz/sources/common/tvectorimage/tcomputeregions.cpp index dee9fc5..8235ce5 100644 --- a/toonz/sources/common/tvectorimage/tcomputeregions.cpp +++ b/toonz/sources/common/tvectorimage/tcomputeregions.cpp @@ -2582,7 +2582,7 @@ public: m_quasiArea += (p2.y + p1.y) * (p1.x - p2.x); } - bool isClockwise() { return m_quasiArea > 0.5; } + bool isClockwise() { return m_quasiArea > 0.1; } }; //---------------------------------------------------------------------------------------------- diff --git a/toonz/sources/image/pli/tiio_pli.cpp b/toonz/sources/image/pli/tiio_pli.cpp index 19caa9e..e2abe83 100644 --- a/toonz/sources/image/pli/tiio_pli.cpp +++ b/toonz/sources/image/pli/tiio_pli.cpp @@ -420,6 +420,8 @@ TImageP TImageReaderPli::doLoad() { outVectImage->checkIntersections(); #endif + outVectImage->findRegions(); + return TImageP(outVectImage); } diff --git a/toonz/sources/tnztools/brushtool.cpp b/toonz/sources/tnztools/brushtool.cpp index 0733933..ab9b4c5 100644 --- a/toonz/sources/tnztools/brushtool.cpp +++ b/toonz/sources/tnztools/brushtool.cpp @@ -374,6 +374,12 @@ static void addStroke(TTool::Application *application, const TVectorImageP &vi, frameCreated, levelCreated)); } + // Update regions. It will call roundStroke() in + // TVectorImage::Imp::findIntersections(). + // roundStroke() will slightly modify all the stroke positions. + // It is needed to update information for Fill Check. + vi->findRegions(); + for (int k = 0; k < (int)strokes.size(); k++) delete strokes[k]; strokes.clear();