More exact testing for scaling/flipping in AffineTransform and only combine transforms when not equal in ForwardExtentCopy

- Fixes #1162
 - Also fixes rotation in x/z axes
Dieser Commit ist enthalten in:
dordsor21 2021-07-10 19:47:39 +01:00
Ursprung 338be0ff31
Commit 41073bb1a0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
2 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -279,6 +279,8 @@ public class ForwardExtentCopy implements Operation {
public Operation resume(RunContext run) throws WorldEditException { public Operation resume(RunContext run) throws WorldEditException {
if (currentTransform == null) { if (currentTransform == null) {
currentTransform = transform; currentTransform = transform;
} else if (!currentTransform.equals(transform)) {
currentTransform = currentTransform.combine(transform);
} }
if (lastBiomeVisitor != null) { if (lastBiomeVisitor != null) {
affectedBiomeCols += lastBiomeVisitor.getAffected(); affectedBiomeCols += lastBiomeVisitor.getAffected();
@ -406,7 +408,6 @@ public class ForwardExtentCopy implements Operation {
} }
if (transExt != null) { if (transExt != null) {
currentTransform = currentTransform.combine(transform);
transExt.setTransform(currentTransform); transExt.setTransform(currentTransform);
} }

Datei anzeigen

@ -306,13 +306,13 @@ public class AffineTransform implements Transform, Serializable {
return true; return true;
} }
// Check for flip-and-rotate // Check for flip-and-rotate
if (vector.getX() != 0 && vector.getY() != 0 && m01 != 0 && m10 != 0) { if (vector.getX() != 0 && vector.getY() != 0 && ((m01 < 0 && m10 < 0) || (m01 > 0 && m10 > 0))) {
flip = true; flip = true;
} }
if (vector.getX() != 0 && vector.getZ() != 0 && m02 != 0 && m20 != 0) { if (vector.getX() != 0 && vector.getZ() != 0 && ((m02 < 0 && m20 < 0) || (m02 > 0 && m20 > 0))) {
flip = !flip; flip = !flip;
} }
if (vector.getY() != 0 && vector.getZ() != 0 && m12 != 0 && m21 != 0) { if (vector.getY() != 0 && vector.getZ() != 0 && ((m12 < 0 && m21 < 0) || (m12 > 0 && m21 > 0))) {
flip = !flip; flip = !flip;
} }
return flip; return flip;