Neil Hodgson
unread,Mar 31, 2018, 5:53:02 PM3/31/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Scintilla mailing list
The right-to-left code currently being worked on appears to need access to the rectangle of the text or, at least, its width. Currently, this is available as Editor::GetClientRectangle and is queried from the system. Its not available to EditView methods unless it is passed in. It is more expensive to make a system call than to access a variable, and Editor receives ChangeSize calls from the platform layer when the window has changed size.
Therefore, I think that the client rectangle should be cached as a field of EditView, set in the ChangeSize method. To preserve current platform code, the existing Editor::GetClientRectangle would stay but a ‘PRectangle rectangleView' would be added to EditView along with GetViewRectangle and SetViewRectangle methods. SetViewRectangle would be called in ChangeSize with the result of GetClientRectangle allowing platform subclasses to override. EditView::GetViewRectangle would replace all calls to GetClientRectangle except for the one in ChangeSize.
There is also a ‘client drawing rectangle’ which is, on most platforms, identical to the client rectangle. On Cocoa, however, extra tiles are drawn (‘prepared’) beyond the area currently visible to allow for high performance scrolling. There doesn’t appear to be a way to receive events when the prepared area changes, so GetClientDrawingRectangle will still need to be called to allow for Cocoa to override.
Neil