var selection = (function(){ var selection = new Matrix (1, 1, function(x,y){ var lex = new Lex (x,y) lex.build() return lex }) // in selection mode.. // - we start by clicking the canvas. this positions the selection, and copies // the character // - then we drag down and to the right. this resizes the selection and pushes new // rows and columns. each of these copies the character underneath. // - on mouseup, the selection is locked. then.. // - drag the selection to move it -- this "cuts" it and leaves a blank space on the canvas. // - shift-drag the selection to copy it return selection })()