Fix mirror being offset (#4248)

Because apparently it isn't a valid map even though its been a known issue for months.
This commit is contained in:
TranquillyUnpleasant 2021-01-03 23:45:35 +05:00 committed by GitHub
parent 3497212b95
commit dbe2f7eefa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,8 +68,8 @@ public class MirrorFilter extends GenerateFilter{
void mirror(Vec2 p, float x0, float y0, float x1, float y1){
//special case: uneven map mirrored at 45 degree angle
if(in.width != in.height && angle % 90 != 0){
p.x = (p.x - in.width/2f) * -1 + in.width/2f;
p.y = (p.y - in.height/2f) * -1 + in.height/2f;
p.x = in.width - p.x - 1;
p.y = in.height - p.y - 1;
}else{
float dx = x1 - x0;
float dy = y1 - y0;