summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.hpp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-25 23:20:32 +0000
committerKarl Berry <karl@freefriends.org>2019-01-25 23:20:32 +0000
commitdbb07a7a7359963676891de548723b36785eff79 (patch)
treee46b8d2cb0e53954b3cb06cab0d9bae28606a9e3 /Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.hpp
parent0c9aa4f80b0f44658e8ba13f2261a2386e99c774 (diff)
dvisvgm 2.6.2
git-svn-id: svn://tug.org/texlive/trunk@49819 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.hpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.hpp44
1 files changed, 41 insertions, 3 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.hpp
index bcf781256b7..31e8e3521d1 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.hpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.hpp
@@ -2,7 +2,7 @@
** GraphicsPath.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2018 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -31,8 +31,7 @@
template <typename T>
-class GraphicsPath
-{
+class GraphicsPath {
friend class PathClipper;
public:
enum class WindingRule {EVEN_ODD, NON_ZERO};
@@ -74,6 +73,20 @@ class GraphicsPath
params[i] = matrix * params[i];
}
+ bool operator == (const Command &cmd) const {
+ bool ret = (type == cmd.type);
+ for (int i=0; ret && i < numParams(); i++)
+ ret &= (params[i] == cmd.params[i]);
+ return ret;
+ }
+
+ bool operator != (const Command &cmd) const {
+ bool ret = (type != cmd.type);
+ for (int i=0; !ret && i < numParams(); i++)
+ ret |= (params[i] != cmd.params[i]);
+ return ret;
+ }
+
Type type;
Point params[3];
};
@@ -317,6 +330,31 @@ class GraphicsPath
command.transform(matrix);
}
+
+ bool operator == (const GraphicsPath &path) const {
+ if (size() != path.size())
+ return false;
+ auto it = _commands.begin();
+ for (const Command &cmd : path._commands) {
+ if (*it++ != cmd)
+ return false;
+ }
+ return true;
+ }
+
+
+ bool operator != (const GraphicsPath &path) const {
+ if (size() != path.size())
+ return true;
+ auto it = _commands.begin();
+ for (const Command &cmd : path._commands) {
+ if (*it++ != cmd)
+ return true;
+ }
+ return false;
+ }
+
+
void iterate (Actions &actions, bool optimize) const;
private: