From 932f5f63ca3cb1ad3a2982d09d078a1573f39d4d Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 3 Dec 2021 16:32:03 +0100 Subject: [PATCH] Fix one off in rotated pasting Signed-off-by: yoyosource --- BauSystem_15/src/de/steamwar/bausystem/region/Region_15.java | 2 +- BauSystem_Main/src/de/steamwar/bausystem/region/Region.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/region/Region_15.java b/BauSystem_15/src/de/steamwar/bausystem/region/Region_15.java index c1c267f3..647fea01 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/region/Region_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/region/Region_15.java @@ -129,7 +129,7 @@ public class Region_15 { BlockVector3 offset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin()); if (pasteOptions.isRotate()) { ch.setTransform(new AffineTransform().rotateY(180)); - v = v.add(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset.multiply(-1, 1, -1)).subtract(1, 0, 1); + v = v.add(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset.multiply(-1, 1, -1)).subtract(0, 0, 1); } else { v = v.subtract(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java index 71a74be5..ee82e57b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java @@ -431,9 +431,10 @@ public class Region { pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2); } else { clipboard = schematic.load(); - if (Math.abs(clipboard.getOrigin().getZ() - clipboard.getMinimumPoint().getZ()) < 2 || Math.abs(clipboard.getOrigin().getZ() - clipboard.getMinimumPoint().getZ()) > prototype.getTestblock().getSizeZ()) { + int dz = Math.abs(clipboard.getOrigin().getZ() - clipboard.getMinimumPoint().getZ()); + if (dz < 2 || dz > prototype.getTestblock().getSizeZ()) { pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2); - } else if (clipboard.getDimensions().getZ() != prototype.getTestblock().getSizeZ()) { + } else if (clipboard.getDimensions().getZ() < prototype.getTestblock().getSizeZ()) { pastePoint = pastePoint.add(0, 0, clipboard.getDimensions().getZ() / 2 - (clipboard.getOrigin().getZ() - clipboard.getMinimumPoint().getZ()) - 1); } else { pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2);