From 08528f577dcb47f570413ce600137f3729a35d94 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sun, 25 May 2014 16:16:00 +0900 Subject: Freestyle: Partial fix for thinning strokes due to flipping stroke directions at TVertices. A description of the problem is found in https://developer.blender.org/T36425#19 . The cause of the issue was identified as roudning errors in Operators::createStroke() due to insufficient numerical precision. Precision promotion from float to double was done in the return values of getPoint3D/2D methods in Interface0D and its subclasses in C++ (data members stored in the 0D classes have already been in double precision). --- source/blender/freestyle/intern/stroke/Stroke.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/freestyle/intern/stroke/Stroke.h') diff --git a/source/blender/freestyle/intern/stroke/Stroke.h b/source/blender/freestyle/intern/stroke/Stroke.h index f6451d8e487..5e6c2fcf6cb 100644 --- a/source/blender/freestyle/intern/stroke/Stroke.h +++ b/source/blender/freestyle/intern/stroke/Stroke.h @@ -375,14 +375,14 @@ public: return _Point2d[1]; } - /*! Returns the 2D point coordinates as a Vec2d */ - Vec2f getPoint () + /*! Returns the 2D point coordinates as a Vec2r */ + inline Vec2r getPoint() const { - return Vec2f((float)point2d()[0], (float)point2d()[1]); + return getPoint2D(); } /*! Returns the ith 2D point coordinate (i=0 or 1)*/ - inline real operator[](const int i) const + inline real operator[](const int i) const { return _Point2d[i]; } @@ -438,7 +438,7 @@ public: } /*! sets the 2D x and y values */ - inline void setPoint(const Vec2f& p) + inline void setPoint(const Vec2r& p) { _Point2d[0] = p[0]; _Point2d[1] = p[1]; -- cgit v1.2.3