Smoother windows animation

This commit is contained in:
Igor Timofeev 2019-01-27 12:01:03 +03:00
parent 33e6d7b107
commit 19a75d99a9

View File

@ -4275,12 +4275,12 @@ function GUI.windowMaximize(window, animationDisabled)
window:addAnimation( window:addAnimation(
function(animation) function(animation)
window.localX, window.localY = window.localX, window.localY =
math.floor(fromX + (toX - fromX) * animation.position + 0.5), math.floor(fromX + (toX - fromX) * animation.position),
math.floor(fromY + (toY - fromY) * animation.position + 0.5) math.floor(fromY + (toY - fromY) * animation.position)
window:resize( window:resize(
math.floor(fromWidth + (toWidth - fromWidth) * animation.position + 0.5), math.floor(fromWidth + (toWidth - fromWidth) * animation.position),
math.floor(fromHeight + (toHeight - fromHeight) * animation.position + 0.5), math.floor(fromHeight + (toHeight - fromHeight) * animation.position),
animation.position < 1 animation.position < 1
) )
end, end,