Lines Matching defs:canvas

1 /// @brief The SketchCanvas class accepts a canvas object to draw on.

2 /// @param canvas The canvas to draw the figure to.
4 /// editmode: The canvas is used for editing when true.
13 /// This event is invoked when the canvas saves its contents into localStorage of the
26 export function SketchCanvas(canvas, options){
49 // Check existence of canvas element and treating not compatible browsers
50 if ( ! canvas || ! canvas.getContext ) {
56 canvas.onclick = mouseLeftClick;
57 canvas.onmousedown = mouseDown;
58 canvas.onmouseup = mouseUp;
59 canvas.onmousemove = mouseMove;
60 canvas.onmouseout = mouseleave;
61 canvas.setAttribute("tabindex", 0); // Make sure the canvas can have a key focus
62 canvas.onkeydown = keyDown;
65 canvas.onclick = viewModeClick;
68 ctx = canvas.getContext('2d');
281 var clrect = canvas.getBoundingClientRect();
377 var clrect = canvas.getBoundingClientRect();
497 var clrect = canvas.getBoundingClientRect();
557 var clrect = canvas.getBoundingClientRect();
655 var clrect = canvas.getBoundingClientRect();
746 var clrect = canvas.getBoundingClientRect();
770 /// Delete given shapes from the canvas.
803 /// Convert canvas coordinates to the source coordinates.
814 /// Draw a shape on the canvas.
847 // Resize the canvas so that it fits the contents.
848 // Note that the canvas contents are also cleared, so we might need to redraw everything.
851 // Resize the canvas so that the figure fits the size of canvas.
854 canvas.width = metaObj.size[0] * scale;
855 canvas.height = metaObj.size[1] * scale;
861 canvas.width = 1024;
862 canvas.height = 640;
1263 img.src = canvas.toDataURL();
1384 // clear canvas
1395 // Sets the size of the canvas
1655 /// SVG or canvas graphics libraries like EaselJS would do this sort of thing
1703 // Show size input layer on top of the canvas because the canvas cannot have
1743 var canvasRect = canvas.getBoundingClientRect();
1884 var clrect = canvas.getBoundingClientRect();
2271 // Show size input layer on top of the canvas because the canvas cannot have
2376 var canvasRect = canvas.getBoundingClientRect();
2546 var clrect = canvas.getBoundingClientRect();
2559 var clrect = canvas.getBoundingClientRect();
2682 // for IE6, IE5 (canvas element wouldn't work from the start, though)