Closed MShark67 closed 2 years ago
Would it make sense to add this to TCustomSynEdit.Paint?
rcClip := Canvas.ClipRect;
if rcClip.IsEmpty then
Exit;
I still can't reliably cause it. I think it might have something to do with a paint message getting through while the window is being "ghosted" by the OS due to the main message window not responding during a long main thread process.
Please check if you are still getting the errors.
I think this has fixed it, thanks!!
In TCustomSynEdit.Paint it first gets the ClipRect from the canvas. It looks like under certain conditions this rect can be empty. If it is empty, the gutter still tries to paint itself, which leads to a "The parameter is incorrect." error when TSynDWrite.ImagingFactory.CreateBitmap is called with a height of zero. It looks like text line painting correctly exits in the case of no lines to paint, it looks like PaintGutter just needs a similar check. Unfortunately I can't always replicate the problem, so I don't know exactly what causes paint to be called with an empty cliprect, but it has to do with loading a very large file or turning word wrap on for a large (wide) file.