bigbluebutton-Github/labs/bbb-html5-client/public/js/models/whiteboard_tool.coffee
Leonardo Crauss Daronco 98a8d05bc1 Add WhiteboardToolModel as a base for whiteboard tools in HTML5
WhiteboardLineModel and WhiteboardRectModel already inherit from it.
2013-04-27 16:54:22 -04:00

34 lines
719 B
CoffeeScript

define [
'jquery',
'underscore',
'backbone',
'raphael',
'globals',
'cs!utils'
], ($, _, Backbone, Raphael, globals, Utils) ->
# A base class for whiteboard tools
WhiteboardToolModel = Backbone.Model.extend
initialize: (@paper) ->
@gh = 0
@gw = 0
@obj = 0
# the defintion of this shape, kept so we can redraw the shape whenever needed
@definition = []
setPaperSize: (@gh, @gw) ->
setOffsets: (@xOffset, @yOffset) ->
setPaperDimensions: (@paperWidth, @paperHeight) ->
# TODO: can't we simply take the width and the height from `@paper`?
getDefinition: () ->
@definition
hide: () ->
@obj.hide() if @obj?
WhiteboardToolModel