Skip to content

Conversation

toad
Copy link

@toad toad commented Jan 27, 2025

This fixes the jumping bug for me (bug 3054: ONLYOFFICE/DocumentServer#3054 ) and is an extension on #4848 .

Note that this includes the patch from @amovsisyan. You will need them to sign the CLA as well as me. Unfortunately they changed the email address they commit with.

@CLAassistant
Copy link

CLAassistant commented Jan 27, 2025

CLA assistant check
All committers have signed the CLA.

@toad toad marked this pull request as draft January 27, 2025 00:35
@toad toad force-pushed the document-editor-screen-jumping-full-fix branch 4 times, most recently from 89a1d77 to e4d61d0 Compare January 28, 2025 16:46
@toad toad force-pushed the document-editor-screen-jumping-full-fix branch from e4d61d0 to 73d1f0e Compare February 25, 2025 23:21
@toad toad marked this pull request as ready for review February 25, 2025 23:21
artur_movsisyan and others added 5 commits April 12, 2025 17:27
amovsisyan's patch looks for an anchor to save the position relative to.
Which works fine as long as there are anchors on every page.
Unfortunately with tables this often is not the case.

If GetDocumentPositionByXY() returns an anchor on a previous, invisible
page, try moving down the current page 10 pixels at a time until we find
an anchor on this page. This is similar to what the code above does.

If that does not work either, we need to reference an anchor on a
previous page. Use ConvertCoordsToAnotherPage() to do this correctly.
When we get an update, we set ViewPosition. This will in theory be used
to position the next rendered frame via CheckTargetUpdate(). However it
can be some time before CheckViewPosition() actually gets as far as
scrolling to the saved position, because of recalculations.

So we need to check whether there has been any scrolling since we saved
ViewPosition.

This adds an additional bit of state, savedTopOffset, which is the top
cursor position of the top page at the time of generating ViewPosition.
Probably it should be on one of the State/ViewPosition Anchor values.
Store it in the correct state object rather than as a property
directly on the Document. This is more consistent and should avoid any
bugs with e.g. state saving on undo.
@toad toad force-pushed the document-editor-screen-jumping-full-fix branch from 73d1f0e to 4626c0c Compare April 12, 2025 16:28
@manicmarvin
Copy link

Any news on whether this PR will be accepted and bundled into the next release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants