fix(Sentry 3228): Bad math sending an incomplete bounds struct to Electron

This commit is contained in:
Ben Gotow 2015-10-05 14:40:45 -07:00
parent d9ac4e4359
commit ea6aa2b643

View file

@ -430,10 +430,12 @@ class Atom extends Model
startTime = Date.now()
boundsForI = (i) ->
x: Math.round(startBounds.x + (width-startBounds.width) * -0.5 * i)
y: Math.round(startBounds.y + (height-startBounds.height) * -0.5 * i)
width: Math.round(startBounds.width + (width-startBounds.width) * i)
height: Math.round(startBounds.height + (height-startBounds.height) * i)
# It's very important this function never return undefined for any of the
# keys which blows up setBounds.
x: Math.round(startBounds.x + (width-startBounds.width) * -0.5 * i) ? 0
y: Math.round(startBounds.y + (height-startBounds.height) * -0.5 * i) ? 0
width: Math.round(startBounds.width + (width-startBounds.width) * i) ? width
height: Math.round(startBounds.height + (height-startBounds.height) * i) ? height
tick = ->
t = Math.min(1, (Date.now() - startTime) / (duration))