Fixed flipping of the central blocks in a clipboard with odd length.

This commit is contained in:
TomyLobo 2011-08-26 14:04:38 +02:00
parent 8e84e7ae18
commit c8bbcbd133

View File

@ -182,7 +182,7 @@ public class CuboidClipboard {
switch (dir) { switch (dir) {
case NORTH_SOUTH: case NORTH_SOUTH:
int wid = (int)Math.ceil(width / 2); int wid = (int)Math.ceil(width / 2.0f);
for (int xs = 0; xs < wid; ++xs) { for (int xs = 0; xs < wid; ++xs) {
for (int z = 0; z < length; ++z) { for (int z = 0; z < length; ++z) {
for (int y = 0; y < height; ++y) { for (int y = 0; y < height; ++y) {
@ -208,7 +208,7 @@ public class CuboidClipboard {
break; break;
case WEST_EAST: case WEST_EAST:
int len = (int)Math.ceil(length / 2); int len = (int)Math.ceil(length / 2.0f);
for (int zs = 0; zs < len; ++zs) { for (int zs = 0; zs < len; ++zs) {
for (int x = 0; x < width; ++x) { for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) { for (int y = 0; y < height; ++y) {
@ -233,7 +233,7 @@ public class CuboidClipboard {
break; break;
case UP_DOWN: case UP_DOWN:
int hei = (int)Math.ceil(height / 2); int hei = (int)Math.ceil(height / 2.0f);
for (int ys = 0; ys < hei; ++ys) { for (int ys = 0; ys < hei; ++ys) {
for (int x = 0; x < width; ++x) { for (int x = 0; x < width; ++x) {
for (int z = 0; z < length; ++z) { for (int z = 0; z < length; ++z) {