From cd3043cf07c274cd641b8483b55177e9a5cb1e10 Mon Sep 17 00:00:00 2001 From: Andrius Ramanauskas Date: Wed, 19 Apr 2006 05:14:26 +0000 Subject: Rendering optimisation, which gives best results for zoomed in drawings with complex (multi-node) paths. Optimisation focus - eliminating cubicTo and LineTo nodes outside of visible area, so no unneeded calculations is needed and less memory is consumed (this avoids crashes which were occurring previously if zooming into a complex drawing) (bzr r541) --- src/livarot/Path.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/livarot/Path.cpp') diff --git a/src/livarot/Path.cpp b/src/livarot/Path.cpp index 32c100310..8ad806349 100644 --- a/src/livarot/Path.cpp +++ b/src/livarot/Path.cpp @@ -428,6 +428,18 @@ int Path::AddPoint(NR::Point const &iPt, bool mvto) } +int Path::ReplacePoint(NR::Point const &iPt) +{ + if (pts.empty()) { + return -1; + } + + int const n = pts.size() - 1; + pts[n] = path_lineto(polyline_lineto, iPt); + return n; +} + + int Path::AddPoint(NR::Point const &iPt, int ip, double it, bool mvto) { if (back == false) { -- cgit v1.2.3