diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-25 11:16:00 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-25 14:47:49 +0400 |
commit | 08528f577dcb47f570413ce600137f3729a35d94 (patch) | |
tree | 6a3a3b792795383fb9180ec7c730eca2b050bbbf /source/blender/freestyle/intern/stroke/Stroke.h | |
parent | aef443ab2d27a79160cca0588bc221457572cead (diff) |
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).
Diffstat (limited to 'source/blender/freestyle/intern/stroke/Stroke.h')
-rw-r--r-- | source/blender/freestyle/intern/stroke/Stroke.h | 10 |
1 files changed, 5 insertions, 5 deletions
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]; |