From 5cf84535c4932156a7f9ea5630f4b5f467b9930c Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Wed, 14 Nov 2007 19:53:05 +0000 Subject: Snap to intersections of line segments (bzr r4082) --- src/livarot/Path.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/livarot/Path.cpp') diff --git a/src/livarot/Path.cpp b/src/livarot/Path.cpp index 8ad806349..726b0001c 100644 --- a/src/livarot/Path.cpp +++ b/src/livarot/Path.cpp @@ -908,6 +908,20 @@ char *Path::svg_dump_path() const return g_strdup (os.str().c_str()); } +// Find out if the segment that corresponds to 'piece' is a straight line +bool Path::IsLineSegment(int piece) +{ + if (piece < 0 || piece >= int(descr_cmd.size())) { + return false; + } + + PathDescr const *theD = descr_cmd[piece]; + int const typ = theD->getType(); + + return (typ == descr_lineto); +} + + /* Local Variables: mode:c++ -- cgit v1.2.3