mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-24 11:50:58 -04:00
Fixed long words in Labels and empty GoldView.
This commit is contained in:
parent
802889d115
commit
78a0efac78
3 changed files with 5 additions and 2 deletions
app
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
@import "app/styles/bootstrap/mixins"
|
||||
|
||||
#gold-view
|
||||
display: none
|
||||
position: absolute
|
||||
right: 46%
|
||||
top: 42px
|
||||
|
|
Loading…
Add table
Reference in a new issue