From 2691c08656fb75d690524ef65e139d00d2f1a315 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 22 Dec 2004 07:46:53 +0000 Subject: [PATCH] + Some changes for Mattias Gaertner, to use canvas in Lazarus --- fcl/image/fpcanvas.pp | 14 +++++++------- fcl/image/fppen.inc | 2 +- fcl/image/fppixlcanv.pp | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fcl/image/fpcanvas.pp b/fcl/image/fpcanvas.pp index aa7e1e36d1..cce2f1ce64 100644 --- a/fcl/image/fpcanvas.pp +++ b/fcl/image/fpcanvas.pp @@ -32,7 +32,7 @@ type TFPCustomCanvas = class; - TFPCanvasHelper = class + TFPCanvasHelper = class(TPersistent) private FColor : TFPColor; FAllocated, @@ -98,26 +98,26 @@ type TFPCustomPen = class (TFPCanvasHelper) private FStyle : TFPPenStyle; - FWidth : byte; + FWidth : Integer; FMode : TFPPenMode; FPattern : longword; protected procedure DoCopyProps (From:TFPCanvasHelper); override; procedure SetMode (AValue : TFPPenMode); virtual; - procedure SetWidth (AValue : byte); virtual; + procedure SetWidth (AValue : Integer); virtual; procedure SetStyle (AValue : TFPPenStyle); virtual; procedure SetPattern (AValue : longword); virtual; public function CopyPen : TFPCustomPen; // Creates a copy of the pen with all properties the same, but not allocated property Style : TFPPenStyle read FStyle write SetStyle; - property Width : byte read FWidth write SetWidth; + property Width : Integer read FWidth write SetWidth; property Mode : TFPPenMode read FMode write SetMode; property Pattern : longword read FPattern write SetPattern; end; TFPCustomPenClass = class of TFPCustomPen; - TFPBrushStyle = (bsClear, bsSolid, bsDiagonal, bsFDiagonal, bsCross, bsDiagCross, + TFPBrushStyle = (bsClear, bsSolid, bsBDiagonal, bsFDiagonal, bsCross, bsDiagCross, bsHorizontal, bsVertical, bsImage, bsPattern); TBrushPattern = array[0..PatternBitCount-1] of TPenPattern; PBrushPattern = ^TBrushPattern; @@ -199,8 +199,8 @@ type procedure DoMoveTo (x,y:integer); virtual; procedure DoLineTo (x,y:integer); virtual; procedure DoLine (x1,y1,x2,y2:integer); virtual; abstract; - procedure DoCopyRect (x,y:integer; canvas:TFPCustomCanvas; SourceRect:TRect); virtual; abstract; - procedure DoDraw (x,y:integer; image:TFPCustomImage); virtual; abstract; + procedure DoCopyRect (x,y:integer; canvas:TFPCustomCanvas; Const SourceRect:TRect); virtual; abstract; + procedure DoDraw (x,y:integer; Const image:TFPCustomImage); virtual; abstract; procedure CheckHelper (AHelper:TFPCanvasHelper); virtual; procedure AddHelper (AHelper:TFPCanvasHelper); public diff --git a/fcl/image/fppen.inc b/fcl/image/fppen.inc index 8e6cf8d189..e4dfc35b5f 100644 --- a/fcl/image/fppen.inc +++ b/fcl/image/fppen.inc @@ -20,7 +20,7 @@ begin FMode := AValue; end; -procedure TFPCustomPen.SetWidth (AValue : byte); +procedure TFPCustomPen.SetWidth (AValue : Integer); begin if AValue < 1 then FWidth := 1 diff --git a/fcl/image/fppixlcanv.pp b/fcl/image/fppixlcanv.pp index 79d983cf82..e5de299633 100644 --- a/fcl/image/fppixlcanv.pp +++ b/fcl/image/fppixlcanv.pp @@ -205,7 +205,7 @@ begin FillRectangleImage (self, left,top, right,bottom, brush.image) else raise PixelCanvasException.Create (sErrNoImage); - bsDiagonal : FillRectangleHashDiagonal (self, b, FHashWidth); + bsBDiagonal : FillRectangleHashDiagonal (self, b, FHashWidth); bsFDiagonal : FillRectangleHashBackDiagonal (self, b, FHashWidth); bsCross : begin @@ -235,7 +235,7 @@ begin FillEllipseImage (self, Bounds, brush.image) else raise PixelCanvasException.Create (sErrNoImage); - bsDiagonal : FillEllipseHashDiagonal (self, Bounds, FHashWidth, brush.color); + bsBDiagonal : FillEllipseHashDiagonal (self, Bounds, FHashWidth, brush.color); bsFDiagonal : FillEllipseHashBackDiagonal (self, Bounds, FHashWidth, brush.color); bsCross : FillEllipseHashCross (self, Bounds, FHashWidth, brush.color); bsDiagCross : FillEllipseHashDiagCross (self, Bounds, FHashWidth, brush.color); @@ -277,7 +277,7 @@ begin FillFloodImage (self, x,y, brush.image) else raise PixelCanvasException.Create (sErrNoImage); - bsDiagonal : FillFloodHashDiagonal (self, x,y, FHashWidth); + bsBDiagonal : FillFloodHashDiagonal (self, x,y, FHashWidth); bsFDiagonal : FillFloodHashBackDiagonal (self, x,y, FHashWidth); bsCross : FillFloodHashCross (self, x,y, FHashWidth); bsDiagCross : FillFloodHashDiagCross (self, x,y, FHashWidth);