[Libreoffice-commits] libcdr.git: src/lib
Fridrich Å trba
fridrich.strba at bluewin.ch
Fri Jul 5 07:04:37 PDT 2013
src/lib/CDRPath.cpp | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
New commits:
commit 8dadbeb2385227a5066beeacf1c48c5121b31a5d
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date: Fri Jul 5 16:04:13 2013 +0200
Code for visual debugging of splines
diff --git a/src/lib/CDRPath.cpp b/src/lib/CDRPath.cpp
index 7f88933..c9e86db 100644
--- a/src/lib/CDRPath.cpp
+++ b/src/lib/CDRPath.cpp
@@ -36,6 +36,10 @@
#define M_PI 3.14159265358979323846
#endif
+#ifndef DEBUG_SPLINES
+#define DEBUG_SPLINES 0
+#endif
+
namespace libcdr
{
@@ -276,14 +280,30 @@ unsigned libcdr::CDRSplineToElement::knot(unsigned i) const
return 0;
if (i > m_points.size())
return (unsigned)(m_points.size() - CDR_SPLINE_DEGREE);
- else
- return i - CDR_SPLINE_DEGREE;
+ return i - CDR_SPLINE_DEGREE;
}
void libcdr::CDRSplineToElement::writeOut(WPXPropertyListVector &vec) const
{
WPXPropertyList node;
+#if DEBUG_SPLINES
+ /* Code for visual debugging of the spline decomposition */
+
+ node.insert("libwpg:path-action", "M");
+ node.insert("svg:x", m_points[0].first);
+ node.insert("svg:y", m_points[0].second);
+ vec.append(node);
+
+ for (unsigned j = 0; j < m_points.size(); ++j)
+ {
+ node.insert("libwpg:path-action", "L");
+ node.insert("svg:x", m_points[j].first);
+ node.insert("svg:y", m_points[j].second);
+ vec.append(node);
+ }
+#endif
+
node.insert("libwpg:path-action", "M");
node.insert("svg:x", m_points[0].first);
node.insert("svg:y", m_points[0].second);
More information about the Libreoffice-commits
mailing list