Skip to content

Fixed asynchronous getscroll and activate regression

Ivica Bukvic requested to merge synchronous-getscroll-before-activating into master
  • 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:
  1. select text object and displace it by dragging using a mouse until it goes partially outside the canvas edge

  2. the object is activated at a location before getscroll changes the viewport settings to ideally fit everything within the window

  3. getscroll is called and everything is relocated except the activated box because its current implementation is oblivious to the changes in canvas positioning.

  4. 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.

Edited by Ivica Bukvic

Merge request reports