Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbrooks committed May 29, 2021
1 parent 7539290 commit 5a82c1b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ class RemoveRedundantCommands : TopDownOptimization, PathElementVisitor {
commands.add(current)
}

if (pathElement.commands.last() is ClosePath) {
if (commands.last() is ClosePath) {
val commandsWithoutFinalClosePath = commands.dropLast(1)
val current = computeAbsoluteCoordinates(commandsWithoutFinalClosePath)
val firstCurrentPoint = firstCommand.parameters.last()

if (current == firstCurrentPoint) {
pathElement.commands = commandsWithoutFinalClosePath
return
commands.removeLast()
}
}

Expand Down

0 comments on commit 5a82c1b

Please sign in to comment.