Less terrible logic UI / Unary operations

This commit is contained in:
Anuken
2020-08-08 20:36:45 -04:00
parent 2042dafb73
commit 4dc90d4074
10 changed files with 156 additions and 31 deletions

View File

@@ -54,9 +54,8 @@ public class MirrorFilter extends GenerateFilter{
float size = Math.max(image.getWidth() *2, image.getHeight()*2);
Cons<Vec2> clamper = v -> v.clamp(
image.x + image.getWidth()/2f - imageWidth/2f,
image.x + image.getWidth()/2f + imageWidth/2f,
image.y + image.getHeight()/2f - imageHeight/2f,
image.y + image.getHeight()/2f + imageHeight/2f);
image.y + image.getHeight()/2f - imageHeight/2f, image.y + image.getHeight()/2f + imageHeight/2f, image.x + image.getWidth()/2f + imageWidth/2f
);
clamper.get(Tmp.v1.trns(angle - 90, size).add(image.getWidth()/2f + image.x, image.getHeight()/2f + image.y));
clamper.get(Tmp.v2.set(Tmp.v1).sub(image.getWidth()/2f + image.x, image.getHeight()/2f + image.y).rotate(180f).add(image.getWidth()/2f + image.x, image.getHeight()/2f + image.y));