Fixed scaling in the thang type editor.

This commit is contained in:
Scott Erickson 2014-05-17 11:49:11 -07:00
parent df222461bf
commit 5907ca8619

View file

@ -221,8 +221,8 @@ module.exports = class ThangTypeEditView extends View
@showMovieClip(animationName) @showMovieClip(animationName)
else else
@showSprite(animationName) @showSprite(animationName)
@updateScale()
@updateRotation() @updateRotation()
@updateScale() # must happen after update rotation, because updateRotation calls the sprite update() method.
showMovieClip: (animationName) -> showMovieClip: (animationName) ->
vectorParser = new SpriteBuilder(@thangType) vectorParser = new SpriteBuilder(@thangType)
@ -279,11 +279,12 @@ module.exports = class ThangTypeEditView extends View
@currentSprite.update(true) @currentSprite.update(true)
updateScale: => updateScale: =>
value = (@scaleSlider.slider('value') + 1) / 10 resValue = (@resolutionSlider.slider('value') + 1) / 10
fixed = value.toFixed(1) scaleValue = (@scaleSlider.slider('value') + 1) / 10
@scale = value fixed = scaleValue.toFixed(1)
@scale = scaleValue
@$el.find('.scale-label').text " #{fixed}x " @$el.find('.scale-label').text " #{fixed}x "
@currentObject.scaleX = @currentObject.scaleY = value if @currentObject? @currentObject.scaleX = @currentObject.scaleY = scaleValue / resValue if @currentObject?
@updateGrid() @updateGrid()
@updateDots() @updateDots()