Improved shortcuts further

This commit is contained in:
Devine Lu Linvega
2017-11-14 08:45:31 +13:00
parent 16ddcfb27a
commit 2042b541a8
7 changed files with 35 additions and 24 deletions

View File

@@ -27,4 +27,16 @@ function Pos(x,y)
{
return new Pos(this.x*a,this.y*a)
}
this.mirror = function(x = -1,y = 1)
{
return new Pos(this.x * x,this.y * y);
}
this.clamp = function(min,max)
{
return new Pos(clamp(this.x,min,max),clamp(this.y,min,max));
}
function clamp(v, min, max) { return v < min ? min : v > max ? max : v; }
}