diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-03-12 10:26:55 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-03-13 09:12:50 +0200 |
commit | 0d02568ff8bd59cd9be9f7e09a444e9cf6689ae2 (patch) | |
tree | 122fe5b3e0f4ddb739602a0fbb218f7f27584920 /thirdparty/msdfgen/core/shape-description.cpp | |
parent | 22c20cea6e59a8a95585adb866c007a55c428806 (diff) | |
download | redot-engine-0d02568ff8bd59cd9be9f7e09a444e9cf6689ae2.tar.gz |
Update ICU and msdfgen.
Diffstat (limited to 'thirdparty/msdfgen/core/shape-description.cpp')
-rw-r--r-- | thirdparty/msdfgen/core/shape-description.cpp | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/thirdparty/msdfgen/core/shape-description.cpp b/thirdparty/msdfgen/core/shape-description.cpp index a096fa2541..32c515d120 100644 --- a/thirdparty/msdfgen/core/shape-description.cpp +++ b/thirdparty/msdfgen/core/shape-description.cpp @@ -244,34 +244,37 @@ bool writeShapeDescription(FILE *output, const Shape &shape) { default:; } } - if (const LinearSegment *e = dynamic_cast<const LinearSegment *>(&**edge)) { - fprintf(output, "\t"); - writeCoord(output, e->p[0]); - fprintf(output, ";\n"); - if (colorCode) - fprintf(output, "\t\t%c;\n", colorCode); - } - if (const QuadraticSegment *e = dynamic_cast<const QuadraticSegment *>(&**edge)) { - fprintf(output, "\t"); - writeCoord(output, e->p[0]); - fprintf(output, ";\n\t\t"); - if (colorCode) - fprintf(output, "%c", colorCode); - fprintf(output, "("); - writeCoord(output, e->p[1]); - fprintf(output, ");\n"); - } - if (const CubicSegment *e = dynamic_cast<const CubicSegment *>(&**edge)) { - fprintf(output, "\t"); - writeCoord(output, e->p[0]); - fprintf(output, ";\n\t\t"); - if (colorCode) - fprintf(output, "%c", colorCode); - fprintf(output, "("); - writeCoord(output, e->p[1]); - fprintf(output, "; "); - writeCoord(output, e->p[2]); - fprintf(output, ");\n"); + const Point2 *p = (*edge)->controlPoints(); + switch ((*edge)->type()) { + case (int) LinearSegment::EDGE_TYPE: + fprintf(output, "\t"); + writeCoord(output, p[0]); + fprintf(output, ";\n"); + if (colorCode) + fprintf(output, "\t\t%c;\n", colorCode); + break; + case (int) QuadraticSegment::EDGE_TYPE: + fprintf(output, "\t"); + writeCoord(output, p[0]); + fprintf(output, ";\n\t\t"); + if (colorCode) + fprintf(output, "%c", colorCode); + fprintf(output, "("); + writeCoord(output, p[1]); + fprintf(output, ");\n"); + break; + case (int) CubicSegment::EDGE_TYPE: + fprintf(output, "\t"); + writeCoord(output, p[0]); + fprintf(output, ";\n\t\t"); + if (colorCode) + fprintf(output, "%c", colorCode); + fprintf(output, "("); + writeCoord(output, p[1]); + fprintf(output, "; "); + writeCoord(output, p[2]); + fprintf(output, ");\n"); + break; } } fprintf(output, "\t#\n"); |