Skip to content

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

C

fix vector fill

shun_iwasawa597034da8d84
diff --git a/toonz/sources/common/tvectorimage/tcomputeregions.cpp b/toonz/sources/common/tvectorimage/tcomputeregions.cpp
index dee9fc554..8235ce5fb 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 19caa9ed8..e2abe836b 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 073393300..ab9b4c56f 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();