Skip to content

Instantly share code, notes, and snippets.

var RenderObject = function(rend, drawingContext){
var currentCtx = (drawingContext !== undefined) ? drawingContext : ctx;
if ( (rend.visible == undefined) ? true : rend.visible){
currentCtx.save();
if (rend.x != undefined && rend.y != undefined)
currentCtx.translate(rend.x, rend.y);
else if (rend.loc != undefined)
currentCtx.translate(rend.loc.getX(), rend.loc.getY());