def draw_rot(x = 0, y = 0, angle = 90, opts = {})
      opts[:canvas] ||= @canvas
      %x{
        var context = #{opts[:canvas].context};
        var width = #{@img}.width;
        var height = #{@img}.height;
        context.translate(#{x}, #{y});
        context.rotate(-#{angle-90}*Math.PI/180.0);
        context.drawImage(#{@img}, -width/2, -height/2, width, height);
        context.rotate(#{angle-90}*Math.PI/180.0);
        context.translate(-#{x}, -#{y});
      }
    end
def draw_rot(x = 0, y = 0, angle = 90, opts = {})
      opts[:canvas] ||= @canvas
      %x{
        var context = #{opts[:canvas].context};
        var width = #{@img}.width;
        var height = #{@img}.height;
        context.translate(#{x}, #{y});
        context.rotate(-#{angle-90}*Math.PI/180.0);
        context.drawImage(#{@img}, -width/2, -height/2, width, height);
        context.rotate(#{angle-90}*Math.PI/180.0);
        context.translate(-#{x}, -#{y});
      }
    end
Draws image to a canvas at an x and y position and rotated at some angle
 x and y represent the center of the image
 angle is in degrees starting by pointing to the right and increasing counterclockwise

 @param [Integer] x (0) x coordinate of center of image
 @param [Integer] y (0) y coordinate of center of image
 @param [Float] angle (90.0) angle of image
 @param [Hash] opts ({}) the options to draw an image.
 @option opts [Dare::Canvas] :canvas (Dare.default_canvas) a canvas to refer to when drawing.

 @example
   image.draw_rot(100, 200, 45) # this will point the top of the image up and to the right

 @example
   image.draw_rot(50, 75, 270, canvas: some_other_canvas)