Made the stroke width adjustable to a whiteboard size on scaling.
This commit is contained in:
parent
3bae5b2313
commit
0f65959bc5
@ -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()
|
||||
|
@ -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: ->
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user