Page 1 of 1

ClipRectangle problem

Posted: Tue Apr 01, 2014 2:37 pm
by 5887289
Hi

I've attached a project that shows a problem when I use ClipRectangle with a custom series. If you click Add Data then re-size the form, the button disappears. It re-appears if you move the mouse over it's position. To avoid the problem, comment out the lines with UnClipRectangle and ClipRectangle.

I'm using XE5 with Update 1.

Cheers, Bob

Re: ClipRectangle problem

Posted: Wed Apr 02, 2014 2:18 pm
by yeray
Hi Bob,

You are calling ClipRectangle at the end of the AfterDraw event, leaving the Canvas clipped. I don't see why would you do that.
This works fine:

Code: Select all

  ParentChart.Canvas.ClipRectangle(ParentChart.ChartRect);
  ParentChart.Canvas.TextOut(200, 200, 'Test Text');
  ParentChart.Canvas.UnClipRectangle;

Re: ClipRectangle problem

Posted: Wed Apr 02, 2014 3:05 pm
by 5887289
Yes I'd wondered about that myself... This is old code written in 2001 by someone else which, strangely, has always worked fine. Looks like he got it the wrong way round....

Thanks, Bob