summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/Pair.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/Pair.hpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/Pair.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Pair.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Pair.hpp
index 44236717efe..c1fdd5b6d58 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Pair.hpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Pair.hpp
@@ -2,7 +2,7 @@
** Pair.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2022 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2023 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 **
@@ -73,6 +73,7 @@ inline T det (const Pair<T> &p1, const Pair<T> &p2) {
struct Pair32 : public Pair<int32_t> {
explicit Pair32 (int32_t x=0, int32_t y=0) : Pair<int32_t>(x, y) {}
explicit Pair32 (double x, double y) : Pair<int32_t>(lround(x), lround(y)) {}
+ explicit Pair32 (const Pair<double> &p) : Pair32(p.x(), p.y()) {}
Pair32 (const Pair<int32_t> &p) : Pair<int32_t>(p) {}
};
@@ -82,6 +83,11 @@ inline DPair round (const DPair &p) {
return DPair(std::lround(p.x()), std::lround(p.y()));
}
+
+template<> template<>
+inline Pair<int>::Pair (const Pair<double> &p) : _x(int(round(p.x()))), _y(int(round(p.y()))) {}
+
+
template <typename T>
IMPLEMENT_ARITHMETIC_OPERATOR(Pair<T>, +)