[fpc-devel] TFPCustomCanvas Expanded Clipping

zeljko zeljko at holobit.net
Wed Nov 30 10:57:54 CET 2011


On Wednesday 30 of November 2011 10:35:59 michael.vancanneyt at wisa.be wrote:

> Create TBaseClipRegion with abstract method PointIsInRegion(P : TPoint)
> (and maybe some others, like line intersections or so).
> 
> Create a descendent TRectClipRegion with property ClipRect: TRect.
> It can implement the abstract method(s).
> 
> Then implement the ClipRegion property, as you propose.
> 
> Setting the ClipRect property just sets ClipRegion to a TRectClipRegion
> instance with the Rect filled in. (TFPCustomCanvas should own this
> instance, i.e. destroy when canvas is destroyed)
> 
> Property clipping just determines whether the ClipRegion object
> is used, yes or no.
> 
> Seems pretty straightforward to me, backwards compatible, and only a single
> extra property is introduced (ClipRegion).

+1. That's how qt organized it's painting (QPainter)
ClipRect = bounding rect of clip region (region can have more than 1 rect eg. 
poly region).

zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20111130/c15c1f36/attachment.html>


More information about the fpc-devel mailing list