Skip to content

Commit 8ccb72b

Browse files
committed
Refactor format path string
1 parent 2f797fe commit 8ccb72b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Parser.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ namespace {
9696
void insertSpaceBeforeEachLetter(std::string &path_string) {
9797
std::string result;
9898
for (int index = 0; index < path_string.size(); index++) {
99-
if (std::isalpha(path_string[index])) {
99+
if (std::isalpha(path_string[index]) &&
100+
tolower(path_string[index]) != 'e') {
100101
result += " ";
101102
result += path_string[index];
102103
result += " ";
103-
} else if (path_string[index] == '-') {
104+
} else if (path_string[index] == '-' && index - 1 >= 0 &&
105+
tolower(path_string[index - 1]) != 'e') {
104106
result += " ";
105107
result += path_string[index];
106108
} else if (path_string[index] == '.') {
@@ -603,7 +605,6 @@ std::vector< PathPoint > Parser::parsePathPoints(xml_node<> *node) {
603605
cur_point = end_point;
604606
}
605607
}
606-
607608
return handle_points;
608609
}
609610

src/Renderer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ void Renderer::drawPath(Gdiplus::Graphics& graphics, Path* path) const {
452452
fmod((long double)(startAngle * 180.0) / M_PI, 360),
453453
fmod((long double)(deltaAngle * 180.0) / M_PI, 360));
454454

455-
if (i + 1 < n && points[i + 1].tc != 'z') gdi_path.StartFigure();
456455
cur_point = end_point;
457456
}
458457
}

0 commit comments

Comments
 (0)