From 9f54969c66e3c69050c15516fec946d4624035ef Mon Sep 17 00:00:00 2001 From: Steven Yi Date: Sat, 29 Sep 2018 21:45:04 -0400 Subject: [PATCH] Simplified line point deletion to add point at start and hold value until end and then drop to end value --- blue-core/src/blue/components/lines/Line.java | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/blue-core/src/blue/components/lines/Line.java b/blue-core/src/blue/components/lines/Line.java index cbcfae2cb..f83420c82 100644 --- a/blue-core/src/blue/components/lines/Line.java +++ b/blue-core/src/blue/components/lines/Line.java @@ -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); } }