From 92b14683ec8e9a6702bf1e92c661283139871b8c Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Jun 20 2018 11:46:49 +0000 Subject: Fix visual artefacts --- diff --git a/synfig-core/src/synfig/rendering/common/task/taskcontour.h b/synfig-core/src/synfig/rendering/common/task/taskcontour.h index 081e85c..2988950 100644 --- a/synfig-core/src/synfig/rendering/common/task/taskcontour.h +++ b/synfig-core/src/synfig/rendering/common/task/taskcontour.h @@ -55,7 +55,7 @@ public: bool allow_antialias; Holder transformation; - TaskContour(): detail(0.5), allow_antialias(true) { } + TaskContour(): detail(1.0), allow_antialias(true) { } virtual Rect calc_bounds() const; diff --git a/synfig-core/src/synfig/rendering/primitive/polyspan.cpp b/synfig-core/src/synfig/rendering/primitive/polyspan.cpp index 960158f..4067146 100644 --- a/synfig-core/src/synfig/rendering/primitive/polyspan.cpp +++ b/synfig-core/src/synfig/rendering/primitive/polyspan.cpp @@ -181,13 +181,21 @@ Polyspan::line_to(Real x, Real y, Real detail) Real dx = x - cur_x; Real dy = y - cur_y; - if (detail && fabs(dx) < detail && fabs(dy) < detail) - { - cur_line_x = x; - cur_line_y = y; - flags |= NotFinishedLine; - return; + if (detail) { + if (fabs(dx) < detail && fabs(dy) < detail) { + cur_line_x = x; + cur_line_y = y; + flags |= NotFinishedLine; + return; + } + + if (flags & NotFinishedLine) { + line_to(cur_line_x, cur_line_y, 0.0); + line_to(x, y, detail); + return; + } } + flags &= ~NotFinishedLine; Real n[4] = {0,0,0,0}; diff --git a/synfig-core/src/synfig/rendering/primitive/polyspan.h b/synfig-core/src/synfig/rendering/primitive/polyspan.h index 4b80b39..b22b701 100644 --- a/synfig-core/src/synfig/rendering/primitive/polyspan.h +++ b/synfig-core/src/synfig/rendering/primitive/polyspan.h @@ -166,9 +166,9 @@ public: void move_to(Real x, Real y); //primitive_to functions - void line_to(Real x, Real y, Real detail = 0.5); - void conic_to(Real x, Real y, Real x1, Real y1, Real detail = 0.5); - void cubic_to(Real x, Real y, Real x1, Real y1, Real x2, Real y2, Real detail = 0.5); + void line_to(Real x, Real y, Real detail = 1.0); + void conic_to(Real x, Real y, Real x1, Real y1, Real detail = 1.0); + void cubic_to(Real x, Real y, Real x1, Real y1, Real x2, Real y2, Real detail = 1.0); void draw_scanline(int y, Real x1, Real y1, Real x2, Real y2); void draw_line(Real x1, Real y1, Real x2, Real y2);