On Mon, 2019-12-16 at 13:10 +0100, Martin Pieuchot wrote:
I'm looking for help/explanation about the coordinate system and
scrolling API to use in `SwAccessibleParagraph'.
I'm currently working on bug #118418 [1], trying to implement
scrollSubstringTo() and scrollSubstringToPoint() like I did for
gtk [2] and evince [3].
The diff below clearly shows that I don't know how to translate a
character index to coordinates that can be feed to Window's Scroll().
So here are my questions:
- Is calling getWindow()'s Scroll() the correct way to realize the
scrolling. If so, the code below doesn't correctly refresh all the
text, so what am I missing?
- What API should I use to convert the coordinates?
I don't know for sure the correct answer, but I feel that for writer
ScrollMDI might be your friend here and that the code should look
something like the attached SwAccessibleParagraph::scrollToPosition
demo. I haven't tested or checked further if its the right approach but
maybe that helps.