scroll position sometimes not at bottom during OnPluginDrawOutputWindow?

Posted by Fiendish on Sun 12 May 2019 12:22 AM — 3 posts, 10,353 views.

USA Global Moderator #0
During rapid output from the server, checking if the main output is scrolled all the way to the end sometimes returns false inside the OnPluginDrawOutputWindow callback.

The code I'm using to check if the scroll position is at the end is:

function at_bottom()
   cur_scroll_position = GetInfo(296)
   text_rectangle_height = GetInfo(293) - GetInfo(291)
   font_height = GetInfo(212)
   total_output_lines = GetInfo(224)
   max_scroll_position = ((total_output_lines-1) * font_height) - text_rectangle_height

   return cur_scroll_position >= max_scroll_position
end


Is there a better way to check whether scrolling is currently locked to the bottom that doesn't sometimes fail inside OnPluginDrawOutputWindow when new output is coming in?
Amended on Sun 12 May 2019 02:04 PM by Fiendish
USA Global Moderator #1
I think it might work if I combine that with a check for whether pause is active or not.
Australia Forum Administrator #2
The pause check should be pretty reliable.