Skip to content

Commit

Permalink
Simplified line point deletion to add point at start and hold value u…
Browse files Browse the repository at this point in the history
…ntil end and then drop to end value
  • Loading branch information
kunstmusik committed Sep 30, 2018
1 parent 660ccbf commit 9f54969
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions blue-core/src/blue/components/lines/Line.java
Original file line number Diff line number Diff line change
Expand Up @@ -1124,22 +1124,13 @@ public void delete(double startTime, double endTime) {
}
}

if (startTime > points.get(points.size() - 1).getX()) {
if (originStart != getValue(startTime, true)) {
insertOrAdjust(startTime, originStart, true);
}
if (originEnd != getValue(endTime, false)) {
insertOrAdjust(endTime, originEnd, false);
if (originStart != originEnd) {
insertOrAdjust(startTime, originEnd, false);
}
if (originStart != getValue(startTime, true)) {
insertOrAdjust(startTime, originStart, true);
}
} else {
if (originStart != getValue(startTime, true)) {
insertOrAdjust(startTime, originStart, true);
if (originStart != originEnd) {
insertOrAdjust(startTime, originEnd, false);
}
}
if (originEnd != getValue(endTime, false)) {
insertOrAdjust(endTime, originEnd, false);
insertOrAdjust(endTime, originStart, true);
}
}

Expand Down

0 comments on commit 9f54969

Please sign in to comment.