Moved two ifs down so that they perform their check on an updated version of viewport.top (which happens in the if on line 808, now 796), rather than the value from the previous frame.
Alternatively, it is possible to move the if on line 808 up to line 738 to update viewport.top sooner. That's is less code changes, but also has a bigger likelihood of changing the behaviour of other code in the file, though I've not noticed anything weird either way.
Fixes #223
Moved two ifs down so that they perform their check on an updated version of
viewport.top
(which happens in theif
on line 808, now 796), rather than the value from the previous frame.Alternatively, it is possible to move the
if
on line 808 up to line 738 to updateviewport.top
sooner. That's is less code changes, but also has a bigger likelihood of changing the behaviour of other code in the file, though I've not noticed anything weird either way.