Skip to content

Commit b4f50ae

Browse files
committed
Fixes #34 (thanks to @oshkop)
1 parent e2b08b0 commit b4f50ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/milchreis/imageprocessing/Flip.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public static PImage apply(PImage image, boolean horizonal, boolean vertical) {
1717

1818
int color = image.get(x, y);
1919

20-
int newx = horizonal ? image.width - x : x;
21-
int newy = vertical ? image.height - y : y;
20+
int newx = horizonal ? (image.width - x) - 1 : x;
21+
int newy = vertical ?( image.height - y ) - 1: y;
2222

2323
output.set(newx, newy, color);
2424
}

0 commit comments

Comments
 (0)