[fpc-devel] TFPCustomCanvas Expanded Clipping

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Dec 7 10:19:07 CET 2011


On Wed, Dec 7, 2011 at 9:45 AM,  <michael.vancanneyt at wisa.be> wrote:
> At first sight I would think this is not a good proposal, because it was a
> conscious decision to do it the way it is done now.
>
> But first please explain what you mean with "This way TCanvas could override
> them more cleanly without the need to hide them." ?

>From Graphics.pas:

  TCanvas = class(TFPCustomCanvas)
    procedure Ellipse(const ARect: TRect); // already in fpcanvas
    procedure Ellipse(x1, y1, x2, y2: Integer); virtual; // already in fpcanvas
......
    procedure Polygon(const Points: array of TPoint); // already in fpcanvas
    procedure Polyline(const Points: array of TPoint;
                       StartIndex: Integer;
                       NumPts: Integer = -1);
    procedure Polyline(Points: PPoint; NumPts: Integer); virtual;
    procedure Polyline(const Points: array of TPoint); // already in fpcanvas
    procedure Rectangle(X1,Y1,X2,Y2: Integer); virtual; // already in fpcanvas
    procedure Rectangle(const ARect: TRect); // already in fpcanvas
    procedure RoundRect(X1, Y1, X2, Y2: Integer; RX,RY: Integer); virtual;
    procedure RoundRect(const Rect: TRect; RX,RY: Integer);
    procedure TextOut(X,Y: Integer; const Text: String); virtual; //
already in fpcanvas

So TCanvas already "overrides" all of the drawing routines in
TFPCustomCanvas, but because they are not virtual he is forced to hide
them.

And like I said I don't think TCanvas will change because that would
impact debugability, in my Mac when it enters unknown routines in the
FCL it doesn't simply go to the next known place, it totally looses
track of where the stepping is going. I already suffer from that in
TLazCanvas because it implements things the "TFPCustomCanvas" way.

So I propose to change TFPCustomCanvas to have virtual, so that we can
more cleanly connect the routines which do the same and have the same
parameters.

-- 
Felipe Monteiro de Carvalho



More information about the fpc-devel mailing list