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:
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?
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?