Fixed long words in Labels and empty GoldView.

This commit is contained in:
Nick Winter 2014-05-12 15:03:53 -07:00
parent 802889d115
commit 78a0efac78
3 changed files with 5 additions and 2 deletions
app
lib
styles/play/level

View file

@ -190,7 +190,7 @@ module.exports = class Angel extends CocoClass
goalStates = testGM?.getGoalStates()
serialized = testWorld.serialize().serializedWorld
window.BOX2D_ENABLED = false
World.deserialize serialized, @angelsShare.worldClassMap, @hsared.lastSerializedWorldFrames, @finishBeholdingWorld(goalStates)
World.deserialize serialized, @angelsShare.worldClassMap, @shared.lastSerializedWorldFrames, @finishBeholdingWorld(goalStates)
window.BOX2D_ENABLED = true
@shared.lastSerializedWorldFrames = serialized.frames

View file

@ -174,6 +174,8 @@ module.exports = class Label extends CocoClass
if width > maxWidth
if row.length is 1 # one long word, truncate it
row[0] = _.string.truncate(row[0], 40)
text.text = row[0]
textWidth = Math.max(text.getMeasuredWidth(), textWidth)
rows.push(row)
row = []
else
@ -182,7 +184,7 @@ module.exports = class Label extends CocoClass
row = [word]
else
textWidth = Math.max(textWidth, width)
rows.push(row)
rows.push(row) if row.length
for row, i in rows
rows[i] = _.string.join(" ", row...)
text: _.string.join("\n", rows...), textWidth: textWidth

View file

@ -2,6 +2,7 @@
@import "app/styles/bootstrap/mixins"
#gold-view
display: none
position: absolute
right: 46%
top: 42px