Clone mutable regions given to clipboards

Fixes #630
Dieser Commit ist enthalten in:
dordsor21 2020-09-18 15:02:25 +01:00
Ursprung 8e8bd810b5
Commit fc91c3b56e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -22,7 +22,7 @@ public abstract class ReadOnlyClipboard extends SimpleClipboard {
public ReadOnlyClipboard(Region region) { public ReadOnlyClipboard(Region region) {
super(region); super(region);
this.region = region; this.region = region.clone();
} }
public static ReadOnlyClipboard of(final Region region) { public static ReadOnlyClipboard of(final Region region) {

Datei anzeigen

@ -63,7 +63,7 @@ public class BlockArrayClipboard implements Clipboard {
public BlockArrayClipboard(Clipboard clipboard, BlockVector3 offset) { public BlockArrayClipboard(Clipboard clipboard, BlockVector3 offset) {
this.parent = clipboard; this.parent = clipboard;
Region shifted = clipboard.getRegion(); Region shifted = clipboard.getRegion().clone();
shifted.shift(offset); shifted.shift(offset);
this.region = shifted; this.region = shifted;
this.origin = shifted.getMinimumPoint(); this.origin = shifted.getMinimumPoint();
@ -84,7 +84,7 @@ public class BlockArrayClipboard implements Clipboard {
checkNotNull(parent); checkNotNull(parent);
checkNotNull(region); checkNotNull(region);
this.parent = parent; this.parent = parent;
this.region = region; this.region = region.clone();
this.origin = region.getMinimumPoint(); this.origin = region.getMinimumPoint();
} }