Page 1 of 1

Force paint message from every item

Posted: Mon Jul 18, 2011 6:29 pm
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?

Posted: Tue Jul 19, 2011 8:53 am
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.