mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 01:31:04 +02:00
TAChart: Extract PrepareSimplePen utility procedure
git-svn-id: trunk@25062 -
This commit is contained in:
parent
3560ac7c3f
commit
78eb50a8d5
@ -366,12 +366,8 @@ var
|
||||
procedure DrawLabelAndTick(const ALabelRect, ATickRect: TRect; const AText: String);
|
||||
begin
|
||||
if Marks.IsLabelHiddenDueToOverlap(prevLabelRect, ALabelRect) then exit;
|
||||
|
||||
ACanvas.Pen.Color := TickColor;
|
||||
ACanvas.Pen.Style := psSolid;
|
||||
ACanvas.Pen.Mode := pmCopy;
|
||||
PrepareSimplePen(ACanvas, TickColor);
|
||||
ACanvas.Line(ATickRect);
|
||||
|
||||
Marks.DrawLabel(ACanvas, ALabelRect, AText);
|
||||
end;
|
||||
|
||||
|
@ -215,6 +215,7 @@ function PointDist(const A, B: TPoint): Integer; inline;
|
||||
function PointDistX(const A, B: TPoint): Integer; inline;
|
||||
function PointDistY(const A, B: TPoint): Integer; inline;
|
||||
|
||||
procedure PrepareSimplePen(ACanvas: TCanvas; AColor: TColor);
|
||||
procedure PrepareXorPen(ACanvas: TCanvas);
|
||||
|
||||
function RectIntersectsRect(
|
||||
@ -494,6 +495,16 @@ begin
|
||||
Result := Abs(A.Y - B.Y);
|
||||
end;
|
||||
|
||||
procedure PrepareSimplePen(ACanvas: TCanvas; AColor: TColor);
|
||||
begin
|
||||
with ACanvas.Pen do begin
|
||||
Color := AColor;
|
||||
Style := psSolid;
|
||||
Mode := pmCopy;
|
||||
Width := 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure PrepareXorPen(ACanvas: TCanvas);
|
||||
begin
|
||||
with ACanvas do begin
|
||||
|
@ -553,9 +553,7 @@ end;
|
||||
|
||||
procedure TChart.Clean(ACanvas: TCanvas; ARect: TRect);
|
||||
begin
|
||||
ACanvas.Pen.Mode := pmCopy;
|
||||
ACanvas.Pen.Style := psSolid;
|
||||
ACanvas.Pen.Color := Color;
|
||||
PrepareSimplePen(ACanvas, Color);
|
||||
ACanvas.Brush.Color := Color;
|
||||
ACanvas.Brush.Style := bsSolid;
|
||||
ACanvas.Rectangle(ARect);
|
||||
|
@ -690,9 +690,6 @@ begin
|
||||
|
||||
FBarPen := TPen.Create;
|
||||
FBarPen.OnChange := @StyleChanged;
|
||||
FBarPen.Mode := pmCopy;
|
||||
FBarPen.Style := psSolid;
|
||||
FBarPen.Width := 1;
|
||||
FBarPen.Color := clBlack;
|
||||
FBarBrush.Color := clRed;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user