Post

Replies

Boosts

Views

Activity

Comment on What is the designated way to do custom background drawing in TextKit 2 when using UITextView/NSTextView?
Thanks for the comment. Seems like my notification for replies didn't come. Doing custom drawing in NSTextView's drawBackground(in:) seems like an interesting workaround. Maybe we can use textViewportLayoutController.viewportRange to find the visible ranges? Or do you mean that call is expensive? Haven't done any tests yet, but if drawBackground(in:) gets called after layout, then it might not be, if the testViewportLayoutController does some caching?
Jul ’22