saros
saros copied to clipboard
Add support for backwards selections
PR #966 introduced optional support to transfer the information whether a selection is actually a backwards selection (i.e. whether the end of the selection is located before the start of the selection).
This option is currently not used by Saros/E (i.e. all local selections are displayed as normal forward selections for all other participants).
To support this feature, the state of the selection should be read on the sender side and be transmitted as part of the activity (using the isBackwardsSelection argument). The state of the selection could, for example, be determined by checking the position of the caret. If it is located at the "start" of the selection range, it is a backwards selection. If it is located at the "end", it is a forwards selection.
The transferred state should then also be displayed for all other participants. This can be done by adjusting the position at which the caret annotation is displayed according to the isBackwardsSelection value of the activity. For backwards selection, the caret should be displayed at the start of the range. For forward selections, it should be displayed at the end of the range (which is the current default).