mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
Fixed scaling in the thang type editor.
This commit is contained in:
parent
df222461bf
commit
5907ca8619
1 changed files with 6 additions and 5 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue