Correct ellipsoidal selector initialization (#1632)

When the previous selection was a non-ellipsoidal region, the
started flag would not be appropriately set until a new selection
had been started.
This commit is contained in:
zml 2021-01-09 20:01:36 -08:00 committed by GitHub
parent 3a3bf3de2c
commit f04ae2f1ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,6 +79,7 @@ public EllipsoidRegionSelector(RegionSelector oldSelector) {
final EllipsoidRegionSelector ellipsoidRegionSelector = (EllipsoidRegionSelector) oldSelector;
region = new EllipsoidRegion(ellipsoidRegionSelector.getIncompleteRegion());
started = ellipsoidRegionSelector.started;
} else {
Region oldRegion;
try {
@ -93,6 +94,7 @@ public EllipsoidRegionSelector(RegionSelector oldSelector) {
BlockVector3 center = pos1.add(pos2).divide(2).floor();
region.setCenter(center);
region.setRadius(pos2.subtract(center).toVector3());
started = true;
}
}