Fixed asynchronous getscroll and activate regression
- This was caused by the improvement in the scrolling algorithm earlier this summer to throttle down getscroll calls invoked by arrays that resulted in CPU intensive redraws. As it turns out, the same also up until this patch prevented the following from working properly:
-
select text object and displace it by dragging using a mouse until it goes partially outside the canvas edge
-
the object is activated at a location before getscroll changes the viewport settings to ideally fit everything within the window
-
getscroll is called and everything is relocated except the activated box because its current implementation is oblivious to the changes in canvas positioning.
-
as a result the activated box does not match the actual object position.
-
The new patch addresses this by introducing a synchronous scroll request that has no delays and executes immediately, thereby completing canvas relocation before the activated box is drawn. Due to its potential to be misused causing high CPU usage, this call is currently reserved only for this special case.
-
LATER: consider ensuring that activated boxes are also relocated on getscroll, so that in the case of scripted changes to the viewport activated boxes remain in a correct place. Even so, this should not be seen as a workaround but as a feature that may prove useful in other contexts. So, the solution is to have both this patch and this other thing eventually implemented.