summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/src/TensorProductPatch.cpp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-08-26 03:02:29 +0000
committerNorbert Preining <norbert@preining.info>2021-08-26 03:02:29 +0000
commit059cab71c68a3fbee36f60e8208d4a47d11c6b60 (patch)
treec982bcbf00c931a1474d68bf51dfeba5918cf76c /dviware/dvisvgm/src/TensorProductPatch.cpp
parent960421b0bcd1af561be3f2eb9468224969a7bd34 (diff)
CTAN sync 202108260302
Diffstat (limited to 'dviware/dvisvgm/src/TensorProductPatch.cpp')
-rw-r--r--dviware/dvisvgm/src/TensorProductPatch.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/dviware/dvisvgm/src/TensorProductPatch.cpp b/dviware/dvisvgm/src/TensorProductPatch.cpp
index dcd31e275d..261dbc28f5 100644
--- a/dviware/dvisvgm/src/TensorProductPatch.cpp
+++ b/dviware/dvisvgm/src/TensorProductPatch.cpp
@@ -2,7 +2,7 @@
** TensorProductPatch.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2021 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 **
@@ -63,7 +63,9 @@ void TensorProductPatch::setFirstMatrixColumn (DPair source[4][4], int col, bool
* @param[in] edgeflag defines how to connect this patch with another one
* @param[in] patch reference patch required if edgeflag > 0 */
void TensorProductPatch::setPoints (const PointVec &points, int edgeflag, ShadingPatch *patch) {
- auto tpPatch = dynamic_cast<TensorProductPatch*>(patch);
+ TensorProductPatch *tpPatch = nullptr;
+ if (patch && patch->psShadingType() == psShadingType())
+ tpPatch = static_cast<TensorProductPatch*>(patch);
if (edgeflag > 0 && !tpPatch)
throw ShadingException("missing preceding data in definition of tensor-product patch");
if ((edgeflag == 0 && points.size() != 16) || (edgeflag > 0 && points.size() != 12))
@@ -107,7 +109,9 @@ void TensorProductPatch::setPoints (const PointVec &points, int edgeflag, Shadin
* @param[in] edgeflag defines how to connect this patch with another one
* @param[in] patch reference patch required if edgeflag > 0 */
void TensorProductPatch::setColors(const ColorVec &colors, int edgeflag, ShadingPatch* patch) {
- auto tpPatch = dynamic_cast<TensorProductPatch*>(patch);
+ TensorProductPatch *tpPatch = nullptr;
+ if (patch && patch->psShadingType() == psShadingType())
+ tpPatch = static_cast<TensorProductPatch*>(patch);
if (edgeflag > 0 && !tpPatch)
throw ShadingException("missing preceding data in definition of tensor-product patch");
if ((edgeflag == 0 && colors.size() != 4) || (edgeflag > 0 && colors.size() != 2))
@@ -492,7 +496,9 @@ DPair CoonsPatch::valueAt (double u, double v) const {
* @param[in] edgeflag defines how to connect this patch to another one
* @param[in] patch reference patch required if edgeflag > 0 */
void CoonsPatch::setPoints (const PointVec &points, int edgeflag, ShadingPatch *patch) {
- auto coonsPatch = dynamic_cast<CoonsPatch*>(patch);
+ CoonsPatch *coonsPatch = nullptr;
+ if (patch && patch->psShadingType() == psShadingType())
+ coonsPatch = static_cast<CoonsPatch*>(patch);
if (edgeflag > 0 && !coonsPatch)
throw ShadingException("missing preceding data in definition of relative Coons patch");
if ((edgeflag == 0 && points.size() != 12) || (edgeflag > 0 && points.size() != 8))
@@ -529,7 +535,9 @@ void CoonsPatch::setPoints (const PointVec &points, int edgeflag, ShadingPatch *
void CoonsPatch::setColors (const ColorVec &colors, int edgeflag, ShadingPatch *patch) {
- auto coonsPatch = dynamic_cast<CoonsPatch*>(patch);
+ CoonsPatch *coonsPatch = nullptr;
+ if (patch && patch->psShadingType() == psShadingType())
+ coonsPatch = static_cast<CoonsPatch*>(patch);
if (edgeflag > 0 && !coonsPatch)
throw ShadingException("missing preceding data in definition of relative Coons patch");
if ((edgeflag == 0 && colors.size() != 4) || (edgeflag > 0 && colors.size() != 2))