diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-01-30 11:31:32 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-01-30 11:34:50 +0100 |
commit | dc6953f932ffbddd5168f039e58075789b91b98b (patch) | |
tree | 0efd42e65ad857da40088736c4be47d4d6a673e5 /writerperfect/source | |
parent | e70541dc4627d63f294837f3eefc1cc25398b703 (diff) |
Initial support for quadratic beziers
Diffstat (limited to 'writerperfect/source')
-rw-r--r-- | writerperfect/source/filter/OdgGenerator.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/writerperfect/source/filter/OdgGenerator.cxx b/writerperfect/source/filter/OdgGenerator.cxx index 79722e8283bd..6d58aa4fb5c6 100644 --- a/writerperfect/source/filter/OdgGenerator.cxx +++ b/writerperfect/source/filter/OdgGenerator.cxx @@ -858,6 +858,13 @@ void OdgGeneratorPrivate::_drawPath(const WPXPropertyListVector &path) qx = (qx < path[k]["svg:x2"]->getDouble()) ? path[k]["svg:x2"]->getDouble() : qx; qy = (qy < path[k]["svg:y2"]->getDouble()) ? path[k]["svg:y2"]->getDouble() : qy; } + if(path[k]["libwpg:path-action"]->getStr() == "Q") + { + px = (px > path[k]["svg:x1"]->getDouble()) ? path[k]["svg:x1"]->getDouble() : px; + py = (py > path[k]["svg:y1"]->getDouble()) ? path[k]["svg:y1"]->getDouble() : py; + qx = (qx < path[k]["svg:x1"]->getDouble()) ? path[k]["svg:x1"]->getDouble() : qx; + qy = (qy < path[k]["svg:y1"]->getDouble()) ? path[k]["svg:y1"]->getDouble() : qy; + } if(path[k]["libwpg:path-action"]->getStr() == "A") { double xmin, xmax, ymin, ymax; @@ -924,6 +931,13 @@ void OdgGeneratorPrivate::_drawPath(const WPXPropertyListVector &path) (unsigned)((path[i]["svg:y"]->getDouble()-py)*2540)); sValue.append(sElement); } + else if (path[i]["libwpg:path-action"]->getStr() == "Q") + { + sElement.sprintf("Q%i %i %i %i", (unsigned)((path[i]["svg:x1"]->getDouble()-px)*2540), + (unsigned)((path[i]["svg:y1"]->getDouble()-py)*2540), (unsigned)((path[i]["svg:x"]->getDouble()-px)*2540), + (unsigned)((path[i]["svg:y"]->getDouble()-py)*2540)); + sValue.append(sElement); + } else if (path[i]["libwpg:path-action"]->getStr() == "A") { sElement.sprintf("A%i %i %i %i %i %i %i", (unsigned)((path[i]["svg:rx"]->getDouble())*2540), |