mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 11:49:23 +02:00
+ Patch from Mattias Gaertner to rename TFPCanvasHelper.Color -> FPCOlor
This commit is contained in:
parent
9d567a3c63
commit
65de79d42b
@ -33,17 +33,17 @@ begin
|
||||
pen.mode := pmCopy;
|
||||
pen.style := psSolid;
|
||||
pen.width := 1;
|
||||
pen.color := colred;
|
||||
with pen.color do
|
||||
pen.FPColor := colred;
|
||||
with pen.FPColor do
|
||||
red := red div 4;
|
||||
Ellipse (10,10, 90,90);
|
||||
|
||||
pen.style := psDashDot;
|
||||
pen.color := colred;
|
||||
pen.FPColor := colred;
|
||||
HashWidth := 10;
|
||||
Ellipse (10,10, 90,90);
|
||||
|
||||
with pen.color do
|
||||
with pen.FPColor do
|
||||
begin
|
||||
red := red div 2;
|
||||
green := red div 4;
|
||||
@ -53,19 +53,19 @@ begin
|
||||
RelativeBrushImage := true;
|
||||
brush.image := ci;
|
||||
brush.style := bsimage;
|
||||
with brush.color do
|
||||
with brush.FPColor do
|
||||
green := green div 2;
|
||||
Ellipse (11,11, 89,89);
|
||||
|
||||
brush.style := bsSolid;
|
||||
brush.color := MyColor;
|
||||
brush.FPColor := MyColor;
|
||||
pen.style := psSolid;
|
||||
pen.width := 3;
|
||||
pen.color := colSilver;
|
||||
pen.FPColor := colSilver;
|
||||
ellipse (30,35, 70,65);
|
||||
|
||||
pen.width := 1;
|
||||
pen.color := colCyan;
|
||||
pen.FPColor := colCyan;
|
||||
ellipseC (50,50, 1,1);
|
||||
|
||||
writeln ('Saving to inspect !');
|
||||
|
@ -34,7 +34,7 @@ type
|
||||
|
||||
TFPCanvasHelper = class(TPersistent)
|
||||
private
|
||||
FColor : TFPColor;
|
||||
FFPColor : TFPColor;
|
||||
FAllocated,
|
||||
FFixedCanvas : boolean;
|
||||
FCanvas : TFPCustomCanvas;
|
||||
@ -52,7 +52,7 @@ type
|
||||
procedure DoAllocateResources; virtual;
|
||||
procedure DoDeAllocateResources; virtual;
|
||||
procedure DoCopyProps (From:TFPCanvasHelper); virtual;
|
||||
procedure SetColor (AValue:TFPColor); virtual;
|
||||
procedure SetFPColor (AValue:TFPColor); virtual;
|
||||
procedure Changing; dynamic;
|
||||
procedure Changed; dynamic;
|
||||
Procedure Lock;
|
||||
@ -70,7 +70,7 @@ type
|
||||
// Canvas for which the helper is allocated
|
||||
property Canvas : TFPCustomCanvas read FCanvas;
|
||||
// color of the helper
|
||||
property Color : TFPColor read FColor Write SetColor;
|
||||
property FPColor : TFPColor read FFPColor Write SetFPColor;
|
||||
property OnChanging: TNotifyEvent read FOnChanging write FOnChanging;
|
||||
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
||||
end;
|
||||
|
@ -31,7 +31,7 @@ begin
|
||||
begin
|
||||
self.FName := FName;
|
||||
self.FSize := FSize;
|
||||
self.FColor := FColor;
|
||||
self.FFPColor := FFPColor;
|
||||
self.FFlags := FFlags;
|
||||
end;
|
||||
end;
|
||||
|
@ -46,9 +46,9 @@ begin
|
||||
Raise TFPFontException.CreateFmt (ErrAllocation, [EFont, ErrAlloc[ValueNeeded]]);
|
||||
end;
|
||||
|
||||
procedure TFPCanvasHelper.SetColor (AValue:TFPColor);
|
||||
procedure TFPCanvasHelper.SetFPColor (AValue:TFPColor);
|
||||
begin
|
||||
FColor := AValue;
|
||||
FFPColor := AValue;
|
||||
end;
|
||||
|
||||
procedure TFPCanvasHelper.Changing;
|
||||
@ -121,7 +121,7 @@ end;
|
||||
procedure TFPCanvasHelper.DoCopyProps (From:TFPCanvasHelper);
|
||||
begin
|
||||
FCanvas := nil;
|
||||
color := from.color;
|
||||
FPColor := from.FPColor;
|
||||
end;
|
||||
|
||||
procedure TFPCanvasHelper.DoAllocateResources;
|
||||
|
@ -86,7 +86,7 @@ begin
|
||||
with result do
|
||||
begin
|
||||
Size := 10;
|
||||
Color := colBlack;
|
||||
FPColor := colBlack;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -95,7 +95,7 @@ begin
|
||||
result := TFPEmptyPen.Create;
|
||||
with result do
|
||||
begin
|
||||
Color := colBlack;
|
||||
FPColor := colBlack;
|
||||
width := 1;
|
||||
pattern := 0;
|
||||
Style := psSolid;
|
||||
@ -142,7 +142,7 @@ var pattern : longword;
|
||||
if clipping then
|
||||
CheckLineClipping (ClipRect, x1,y1, x2,y2);
|
||||
if x1 >= 0 then
|
||||
DrawSolidLine (self, x1,y1, x2,y2, pen.color)
|
||||
DrawSolidLine (self, x1,y1, x2,y2, Pen.FPColor)
|
||||
end;
|
||||
|
||||
procedure CheckPLine (x1,y1, x2,y2 : integer);
|
||||
@ -150,7 +150,7 @@ var pattern : longword;
|
||||
if clipping then
|
||||
CheckLineClipping (ClipRect, x1,y1, x2,y2);
|
||||
if x1 >= 0 then
|
||||
DrawPatternLine (self, x1,y1, x2,y2, pattern, pen.color)
|
||||
DrawPatternLine (self, x1,y1, x2,y2, pattern, Pen.FPColor)
|
||||
end;
|
||||
|
||||
var b : TRect;
|
||||
@ -225,8 +225,8 @@ end;
|
||||
procedure TFPPixelCanvas.DoEllipseFill (const Bounds:TRect);
|
||||
begin
|
||||
case Brush.style of
|
||||
bsSolid : FillEllipseColor (self, Bounds, brush.color);
|
||||
bsPattern : FillEllipsePattern (self, Bounds, brush.pattern, brush.color);
|
||||
bsSolid : FillEllipseColor (self, Bounds, Brush.FPColor);
|
||||
bsPattern : FillEllipsePattern (self, Bounds, brush.pattern, Brush.FPColor);
|
||||
bsImage :
|
||||
if assigned (brush.image) then
|
||||
if FRelativeBI then
|
||||
@ -235,12 +235,12 @@ begin
|
||||
FillEllipseImage (self, Bounds, brush.image)
|
||||
else
|
||||
raise PixelCanvasException.Create (sErrNoImage);
|
||||
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);
|
||||
bsHorizontal : FillEllipseHashHorizontal (self, Bounds, FHashWidth, brush.color);
|
||||
bsVertical : FillEllipseHashVertical (self, Bounds, FHashWidth, brush.color);
|
||||
bsBDiagonal : FillEllipseHashDiagonal (self, Bounds, FHashWidth, Brush.FPColor);
|
||||
bsFDiagonal : FillEllipseHashBackDiagonal (self, Bounds, FHashWidth, Brush.FPColor);
|
||||
bsCross : FillEllipseHashCross (self, Bounds, FHashWidth, Brush.FPColor);
|
||||
bsDiagCross : FillEllipseHashDiagCross (self, Bounds, FHashWidth, Brush.FPColor);
|
||||
bsHorizontal : FillEllipseHashHorizontal (self, Bounds, FHashWidth, Brush.FPColor);
|
||||
bsVertical : FillEllipseHashVertical (self, Bounds, FHashWidth, Brush.FPColor);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -250,13 +250,13 @@ begin
|
||||
case style of
|
||||
psSolid :
|
||||
if pen.width > 1 then
|
||||
DrawSolidEllipse (self, Bounds, width, color)
|
||||
DrawSolidEllipse (self, Bounds, width, FPColor)
|
||||
else
|
||||
DrawSolidEllipse (self, Bounds, color);
|
||||
DrawSolidEllipse (self, Bounds, FPColor);
|
||||
psPattern:
|
||||
DrawPatternEllipse (self, Bounds, pattern, color);
|
||||
DrawPatternEllipse (self, Bounds, pattern, FPColor);
|
||||
psDash, psDot, psDashDot, psDashDotDot :
|
||||
DrawPatternEllipse (self, Bounds, PenPatterns[Style], color);
|
||||
DrawPatternEllipse (self, Bounds, PenPatterns[Style], FPColor);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -321,7 +321,7 @@ procedure TFPPixelCanvas.DoLine (x1,y1,x2,y2:integer);
|
||||
begin
|
||||
if Clipping then
|
||||
CheckLineClipping (ClipRect, xx1,yy1, xx2,yy2);
|
||||
DrawSolidLine (self, xx1,yy1, xx2,yy2, pen.color);
|
||||
DrawSolidLine (self, xx1,yy1, xx2,yy2, Pen.FPColor);
|
||||
end;
|
||||
|
||||
procedure SolidThickLine;
|
||||
@ -357,7 +357,7 @@ begin
|
||||
case Pen.style of
|
||||
psSolid :
|
||||
begin
|
||||
DrawSolidLine (self, x1,y1, x2,y2, pen.color);
|
||||
DrawSolidLine (self, x1,y1, x2,y2, Pen.FPColor);
|
||||
if pen.width > 1 then
|
||||
SolidThickLine;
|
||||
end;
|
||||
|
@ -278,7 +278,7 @@ procedure TFreeTypeFont.DrawChar (x,y:integer; data:PByteArray; pitch, width, he
|
||||
g := ((green * a) + (c.green * t)) div 255;
|
||||
b := ((blue * a) + (c.blue * t)) div 255;
|
||||
end;
|
||||
canv.colors[x,y] := FPcolor(r,g,b,alphaOpaque);
|
||||
canv.colors[x,y] := FPImage.FPColor(r,g,b,alphaOpaque);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -288,7 +288,7 @@ begin
|
||||
for ry := 0 to height-1 do
|
||||
begin
|
||||
for rx := 0 to width-1 do
|
||||
combine (canvas, x+rx, y+ry, color, data^[b+rx]);
|
||||
combine (canvas, x+rx, y+ry, FPColor, data^[b+rx]);
|
||||
inc (b, pitch);
|
||||
end;
|
||||
end;
|
||||
@ -305,7 +305,7 @@ begin
|
||||
begin
|
||||
rb := rx mod 8;
|
||||
if (data^[b+l] and bits[rb]) <> 0 then
|
||||
canvas.colors[x+rx,y+ry] := color;
|
||||
canvas.colors[x+rx,y+ry] := FPColor;
|
||||
if rb = 7 then
|
||||
inc (l);
|
||||
end;
|
||||
|
@ -65,7 +65,7 @@ uses clipping, ellipses;
|
||||
|
||||
procedure FillRectangleColor (Canv:TFPCustomCanvas; x1,y1, x2,y2:integer);
|
||||
begin
|
||||
FillRectangleColor (Canv, x1,y1, x2,y2, canv.brush.color);
|
||||
FillRectangleColor (Canv, x1,y1, x2,y2, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillRectangleColor (Canv:TFPCustomCanvas; x1,y1, x2,y2:integer; const color:TFPColor);
|
||||
@ -128,7 +128,7 @@ end;
|
||||
|
||||
procedure DrawSolidLine (Canv : TFPCustomCanvas; x1,y1, x2,y2:integer);
|
||||
begin
|
||||
DrawSolidLine (Canv, x1,y1, x2,y2, Canv.pen.color);
|
||||
DrawSolidLine (Canv, x1,y1, x2,y2, Canv.Pen.FPColor);
|
||||
end;
|
||||
|
||||
procedure DrawSolidLine (Canv : TFPCustomCanvas; x1,y1, x2,y2:integer; const color:TFPColor);
|
||||
@ -248,7 +248,7 @@ end;
|
||||
|
||||
procedure DrawPatternLine (Canv:TFPCustomCanvas; x1,y1, x2,y2:integer; Pattern:TPenPattern);
|
||||
begin
|
||||
DrawPatternLine (Canv, x1,y1, x2,y2, pattern, canv.pen.color);
|
||||
DrawPatternLine (Canv, x1,y1, x2,y2, pattern, Canv.Pen.FPColor);
|
||||
end;
|
||||
|
||||
procedure DrawPatternLine (Canv:TFPCustomCanvas; x1,y1, x2,y2:integer; Pattern:TPenPattern; const color:TFPColor);
|
||||
@ -357,7 +357,7 @@ end;
|
||||
|
||||
procedure FillRectangleHashHorizontal (Canv:TFPCustomCanvas; const rect:TRect; width:integer);
|
||||
begin
|
||||
FillRectangleHashHorizontal (Canv, rect, width, canv.brush.color);
|
||||
FillRectangleHashHorizontal (Canv, rect, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillRectangleHashHorizontal (Canv:TFPCustomCanvas; const rect:TRect; width:integer; const c:TFPColor);
|
||||
@ -376,7 +376,7 @@ end;
|
||||
|
||||
procedure FillRectangleHashVertical (Canv:TFPCustomCanvas; const rect:TRect; width:integer);
|
||||
begin
|
||||
FillRectangleHashVertical (Canv, rect, width, canv.brush.color);
|
||||
FillRectangleHashVertical (Canv, rect, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillRectangleHashVertical (Canv:TFPCustomCanvas; const rect:TRect; width:integer; const c:TFPColor);
|
||||
@ -395,7 +395,7 @@ end;
|
||||
|
||||
procedure FillRectangleHashDiagonal (Canv:TFPCustomCanvas; const rect:TRect; width:integer);
|
||||
begin
|
||||
FillRectangleHashDiagonal (Canv, rect, width, canv.brush.color);
|
||||
FillRectangleHashDiagonal (Canv, rect, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillRectangleHashDiagonal (Canv:TFPCustomCanvas; const rect:TRect; width:integer; const c:TFPColor);
|
||||
@ -465,7 +465,7 @@ end;
|
||||
|
||||
procedure FillRectangleHashBackDiagonal (Canv:TFPCustomCanvas; const rect:TRect; width:integer);
|
||||
begin
|
||||
FillRectangleHashBackDiagonal (Canv, rect, width, canv.brush.color);
|
||||
FillRectangleHashBackDiagonal (Canv, rect, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillRectangleHashBackDiagonal (Canv:TFPCustomCanvas; const rect:TRect; width:integer; const c:TFPColor);
|
||||
@ -542,7 +542,7 @@ end;
|
||||
|
||||
procedure FillRectanglePattern (Canv:TFPCustomCanvas; x1,y1, x2,y2:integer; const pattern:TBrushPattern);
|
||||
begin
|
||||
FillRectanglePattern (Canv, x1,y1, x2,y2, pattern, canv.brush.color);
|
||||
FillRectanglePattern (Canv, x1,y1, x2,y2, pattern, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillRectanglePattern (Canv:TFPCustomCanvas; x1,y1, x2,y2:integer; const pattern:TBrushPattern; const color:TFPColor);
|
||||
@ -906,7 +906,7 @@ end;
|
||||
|
||||
procedure FillFloodColor (Canv:TFPCustomCanvas; x,y:integer);
|
||||
begin
|
||||
FillFloodColor (Canv, x, y, canv.brush.color);
|
||||
FillFloodColor (Canv, x, y, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
type
|
||||
@ -953,7 +953,7 @@ end;
|
||||
|
||||
procedure FillFloodPattern (Canv:TFPCustomCanvas; x,y:integer; const pattern:TBrushPattern);
|
||||
begin
|
||||
FillFloodPattern (Canv, x, y, pattern, Canv.Brush.color);
|
||||
FillFloodPattern (Canv, x, y, pattern, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
type
|
||||
@ -1045,7 +1045,7 @@ end;
|
||||
|
||||
procedure FillFloodHashHorizontal (Canv:TFPCustomCanvas; x,y:integer; width:integer);
|
||||
begin
|
||||
FillFloodHashHorizontal (Canv, x, y, width, Canv.Brush.color);
|
||||
FillFloodHashHorizontal (Canv, x, y, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillFloodHashVertical (Canv:TFPCustomCanvas; x,y:integer; width:integer; const c:TFPColor);
|
||||
@ -1055,7 +1055,7 @@ end;
|
||||
|
||||
procedure FillFloodHashVertical (Canv:TFPCustomCanvas; x,y:integer; width:integer);
|
||||
begin
|
||||
FillFloodHashVertical (Canv, x, y, width, Canv.Brush.color);
|
||||
FillFloodHashVertical (Canv, x, y, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillFloodHashDiagonal (Canv:TFPCustomCanvas; x,y:integer; width:integer; const c:TFPColor);
|
||||
@ -1065,7 +1065,7 @@ end;
|
||||
|
||||
procedure FillFloodHashDiagonal (Canv:TFPCustomCanvas; x,y:integer; width:integer);
|
||||
begin
|
||||
FillFloodHashDiagonal (Canv, x, y, width, Canv.Brush.color);
|
||||
FillFloodHashDiagonal (Canv, x, y, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillFloodHashBackDiagonal (Canv:TFPCustomCanvas; x,y:integer; width:integer; const c:TFPColor);
|
||||
@ -1075,7 +1075,7 @@ end;
|
||||
|
||||
procedure FillFloodHashBackDiagonal (Canv:TFPCustomCanvas; x,y:integer; width:integer);
|
||||
begin
|
||||
FillFloodHashBackDiagonal (Canv, x, y, width, Canv.Brush.color);
|
||||
FillFloodHashBackDiagonal (Canv, x, y, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillFloodHashDiagCross (Canv:TFPCustomCanvas; x,y:integer; width:integer; const c:TFPColor);
|
||||
@ -1085,7 +1085,7 @@ end;
|
||||
|
||||
procedure FillFloodHashDiagCross (Canv:TFPCustomCanvas; x,y:integer; width:integer);
|
||||
begin
|
||||
FillFloodHashDiagCross (Canv, x, y, width, Canv.Brush.color);
|
||||
FillFloodHashDiagCross (Canv, x, y, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
procedure FillFloodHashCross (Canv:TFPCustomCanvas; x,y:integer; width:integer; const c:TFPColor);
|
||||
@ -1095,7 +1095,7 @@ end;
|
||||
|
||||
procedure FillFloodHashCross (Canv:TFPCustomCanvas; x,y:integer; width:integer);
|
||||
begin
|
||||
FillFloodHashCross (Canv, x, y, width, Canv.Brush.color);
|
||||
FillFloodHashCross (Canv, x, y, width, Canv.Brush.FPColor);
|
||||
end;
|
||||
|
||||
type
|
||||
|
@ -274,12 +274,12 @@ begin
|
||||
end;
|
||||
FPen := TPSPen.Create;
|
||||
FPen.Width := 1;
|
||||
FPen.Color := 0;
|
||||
FPen.FPColor := 0;
|
||||
FPen.OnChange := @PenChanged;
|
||||
|
||||
FBrush := TPSPen.Create;
|
||||
FBrush.Width := 1;
|
||||
FBrush.Color := -1;
|
||||
FBrush.FPColor := -1;
|
||||
// don't notify us that the brush changed...
|
||||
}
|
||||
end;
|
||||
@ -815,13 +815,13 @@ begin
|
||||
Result:='/Pattern setcolorspace '+FPattern.Name+' setcolor '
|
||||
else
|
||||
begin
|
||||
Result:='[/Pattern /DeviceRGB] setcolorspace '+inttostr(Color.Red)+' '+inttostr(Color.Green)+' '+
|
||||
inttostr(Color.Blue)+' '+FPattern.Name+' setcolor ';
|
||||
Result:='[/Pattern /DeviceRGB] setcolorspace '+inttostr(FPColor.Red)+' '+inttostr(FPColor.Green)+' '+
|
||||
inttostr(FPColor.Blue)+' '+FPattern.Name+' setcolor ';
|
||||
end;
|
||||
end
|
||||
else // no pattern do this:
|
||||
Result:=inttostr(Color.Red)+' '+inttostr(Color.Green)+' '+
|
||||
inttostr(Color.Blue)+' setrgbcolor ';
|
||||
Result:=inttostr(FPColor.Red)+' '+inttostr(FPColor.Green)+' '+
|
||||
inttostr(FPColor.Blue)+' setrgbcolor ';
|
||||
Result := Result + format('%f',[Width])+' setlinewidth ';
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user