Made the stroke width adjustable to a whiteboard size on scaling.

This commit is contained in:
Maxim Khlobystov 2014-11-03 14:26:11 -08:00
parent 3bae5b2313
commit 0f65959bc5
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@ Template.whiteboard.rendered = ->
adjustedDimensions = scaleSlide(this.width, this.height)
wpm = whiteboardPaperModel
wpm.setAdjustedDimensions(adjustedDimensions.width, adjustedDimensions.height)
wpm.clearShapes()
wpm.clearCursor()
manuallyDisplayShapes()

View File

@ -368,6 +368,8 @@ class Meteor.WhiteboardPaperModel
# Make a shape `shape` with the data in `data`.
makeShape: (shape, data) ->
data.thickness *= @adjustedWidth / 1000
tool = null
@current[shape] = @_createTool(shape)
@ -467,6 +469,10 @@ class Meteor.WhiteboardPaperModel
newHeight = @adjustedHeight * heightRatio / 100
@raphaelObj.setViewBox(newX, newY, newWidth, newHeight) # zooms and pans
setAdjustedDimensions: (width, height) ->
@adjustedWidth = width
@adjustedHeight = height
# Registers listeners for events in the gloval event bus
_registerEvents: ->