summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-1.0.2-PATCHES/patch-01-path
blob: de62a54225f42c26029ccd4dbed5479c9574da02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff -ur dvisvgm-1.0.2.orig/src/GraphicPath.h dvisvgm-1.0.2/src/GraphicPath.h
--- dvisvgm-1.0.2.orig/src/GraphicPath.h	2010-06-16 19:09:47.000000000 +0200
+++ dvisvgm-1.0.2/src/GraphicPath.h	2010-07-05 10:38:09.963061244 +0200
@@ -247,7 +247,7 @@
  *  @param[in] optimize if true, shorthand drawing commands (sconicto, scubicto,...) are considered */
 template <typename T>
 void GraphicPath<T>::iterate (Actions &actions, bool optimize) const {
-	ConstIterator prev;  // pointer to preceding command
+	ConstIterator prev = _commands.end();  // pointer to preceding command
 	Point fp; // first point of current path
 	Point cp; // current point
 	Point pstore[2];
@@ -280,7 +280,7 @@
 				}
 				break;
 			case Command::CONICTO:
-				if (optimize && prev->type == Command::CONICTO && params[0] == pstore[1]*T(2)-pstore[0]) {
+				if (optimize && prev != _commands.end() && prev->type == Command::CONICTO && params[0] == pstore[1]*T(2)-pstore[0]) {
 					actions.sconicto(params[1]);
 					actions.draw('T', params+1, 1);
 				}
@@ -293,7 +293,7 @@
 				break;
 			case Command::CUBICTO:
 				// is first control point reflection of preceding second control point?
-				if (optimize && prev->type == Command::CUBICTO && params[0] == pstore[1]*T(2)-pstore[0]) {
+				if (optimize && prev != _commands.end() && prev->type == Command::CUBICTO && params[0] == pstore[1]*T(2)-pstore[0]) {
 					actions.scubicto(params[1], params[2]);
 					actions.draw('S', params+1, 2);
 				}
diff -ur dvisvgm-1.0.2.orig/src/PsSpecialHandler.h dvisvgm-1.0.2/src/PsSpecialHandler.h
--- dvisvgm-1.0.2.orig/src/PsSpecialHandler.h	2010-06-17 19:07:35.000000000 +0200
+++ dvisvgm-1.0.2/src/PsSpecialHandler.h	2010-07-05 10:38:09.963061244 +0200
@@ -31,9 +31,10 @@
 
 class PsSpecialHandler : public SpecialHandler, protected PSActions
 {
+	typedef GraphicPath<double> Path;
+	
 	class ClippingStack
 	{
-		typedef GraphicPath<double> Path;
 		public:
 			void push ();
 			void push (const Path &path);
@@ -100,7 +101,7 @@
 		SpecialActions *_actions;
 		bool _initialized;
 		XMLElementNode *_xmlnode;   ///< if != 0, created SVG elements are appended to this node
-		GraphicPath<double> _path;
+		Path _path;
 		DPair _currentpoint;        ///< current PS position
 		double _linewidth;          ///< current linewidth
 		double _miterlimit;         ///< current miter limit