Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class Resizing extends Spine.Controller

events:
'drag.resize': 'resize'
'start.resize': 'save'
'end.resize': 'save'

constructor: (@element) ->
super(el: @element.el)
Expand Down Expand Up @@ -98,14 +100,14 @@ class Resizing extends Spine.Controller
area.left += position.left

if lockAR
# TODO - FIXME, this doesn't lock AR properly
area.width = Math.max(area.width, area.height)
area.height = area.width
area.width = @area.width * area.height / @area.height

# Make sure we can't have negative widths/heights
area.width = Math.max(0, area.width)
area.height = Math.max(0, area.height)

@element.resize(area)
save: ->
@area = @element.area()

module.exports = Resizing