Iosevka/support/anchor.ptl
2016-02-04 07:32:04 +08:00

22 lines
649 B
Plaintext

export all : class Anchor
public [new x y type mbx mby] : begin
set this.x x
set this.y y
set this.type type
set this.mbx mbx
set this.mby mby
static BASE 'base'
static MARK 'mark'
static [transform tfm a] : begin
local x : a.x * tfm.xx + a.y * tfm.yx + tfm.x
local y : a.x * tfm.xy + a.y * tfm.yy + tfm.y
if (a.mbx !== nothing && a.mby !== nothing) : then
local mbx : a.mbx * tfm.xx + a.mby * tfm.yx + tfm.x
local mby : a.mbx * tfm.xy + a.mby * tfm.yy + tfm.y
return : new Anchor x y a.type mbx mby
: else
return : new Anchor x y a.type
public [transform tfm] : Anchor.transform tfm this