Fix some /paste not working with scale and /replace should not be affected by /scale. (Thanks goodlyay)

This commit is contained in:
UnknownShadow200 2016-08-26 16:09:44 +10:00
parent 53cd907b8c
commit e36520f68b
2 changed files with 5 additions and 3 deletions

View File

@ -30,6 +30,7 @@ namespace MCGalaxy.Drawing.Ops {
} }
public override string Name { get { return "Replace"; } } public override string Name { get { return "Replace"; } }
public override bool AffectedByTransform { get { return false; } }
public override long GetBlocksAffected(Level lvl, Vec3S32[] marks) { public override long GetBlocksAffected(Level lvl, Vec3S32[] marks) {
return (Max.X - Min.X + 1) * (Max.Y - Min.Y + 1) * (Max.Z - Min.Z + 1); return (Max.X - Min.X + 1) * (Max.Y - Min.Y + 1) * (Max.Z - Min.Z + 1);
@ -59,6 +60,7 @@ namespace MCGalaxy.Drawing.Ops {
} }
public override string Name { get { return "ReplaceNot"; } } public override string Name { get { return "ReplaceNot"; } }
public override bool AffectedByTransform { get { return false; } }
public override long GetBlocksAffected(Level lvl, Vec3S32[] marks) { public override long GetBlocksAffected(Level lvl, Vec3S32[] marks) {
return (Max.X - Min.X + 1) * (Max.Y - Min.Y + 1) * (Max.Z - Min.Z + 1); return (Max.X - Min.X + 1) * (Max.Y - Min.Y + 1) * (Max.Z - Min.Z + 1);

View File

@ -53,9 +53,9 @@ namespace MCGalaxy.Drawing.Transforms {
// Guess the direction in which we should be scaling - // Guess the direction in which we should be scaling -
// for simplicity we assume we are scaling in positive direction // for simplicity we assume we are scaling in positive direction
P = op.Origin; P = op.Origin;
dirX = (P.X == op.Max.X || op.Min.X == op.Max.X) ? -1 : 1; dirX = op.Min.X == op.Max.X ? 1 : (P.X == op.Max.X ? -1 : 1);
dirY = (P.Y == op.Max.Y || op.Min.Y == op.Max.Y) ? -1 : 1; dirY = op.Min.Y == op.Max.Y ? 1 : (P.Y == op.Max.Y ? -1 : 1);
dirZ = (P.Z == op.Max.Z || op.Min.Z == op.Max.Z) ? -1 : 1; dirZ = op.Min.Z == op.Max.Z ? 1 : (P.Z == op.Max.Z ? -1 : 1);
} }
foreach (DrawOpBlock b in op.Perform(marks, p, lvl, brush)) { foreach (DrawOpBlock b in op.Perform(marks, p, lvl, brush)) {