Force paint message from every item

General TRichView support forum. Please post your questions here
Post Reply
blsstdok
Posts: 25
Joined: Tue Jun 07, 2011 2:36 pm

Force paint message from every item

Post by blsstdok »

I need every item in the document to receive a paint message, not just the items in an invalidation rect. This is because I am rendering special effects like shadows, which can paint outside of their TextExtent. I am handling the painting myself and can deal with checing the clipping rect on my own -- but I need for every item to have a chance to paint, not just the ones the editor thinks are in view.

I've made various attempts to get the TCustomRVFormattedData.PaintTo procedure to avoid clipping out items that it thinks are outside of the invalidated rect, such as sending it an AClipRect with dimensions of the whole document. I must be missing something, because items scrolled off the screen don't seem to be included.

What is the best way to ensure that every item in the document "tries" to get painted, even if they reside outside of the clipping rect?
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Consider changing TCustomRVFormattedData.InvalidateRect to invalidate larger rectangle.
For example, if shadow can go no more than 5 pixels from text, you can inflate the rectangle by 5 pixels in each side.
Post Reply