Update commit boundaries after moving waypoints.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1084
This commit is contained in:
Dan Albert
2021-05-15 21:57:37 -07:00
parent 53cb68f82c
commit 5d9563304f
2 changed files with 32 additions and 22 deletions

View File

@@ -479,7 +479,9 @@ class Flight {
this.flight = flight;
this.flightPlan = this.flight.flightPlan.map((p) => new Waypoint(p, this));
this.path = null;
this.commitBoundary = null;
this.flight.flightPlanChanged.connect(() => this.draw());
this.flight.commitBoundaryChanged.connect(() => this.drawCommitBoundary());
}
shouldMark(waypoint) {
@@ -509,9 +511,14 @@ class Flight {
}
drawCommitBoundary() {
if (this.commitBoundary != null) {
this.commitBoundary
.removeFrom(this.flightPlanLayer())
.removeFrom(selectedFlightPlansLayer);
}
if (this.flight.selected) {
if (this.flight.commitBoundary) {
L.polyline(this.flight.commitBoundary, {
this.commitBoundary = L.polyline(this.flight.commitBoundary, {
color: Colors.Highlight,
weight: 1,
})