mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 20:47:58 +02:00
TAChart: Avoid painting of gaps in non-solid series using the brush color when ChartStyles are active.
git-svn-id: trunk@62094 -
This commit is contained in:
parent
753c843f12
commit
834b592281
@ -1109,7 +1109,8 @@ var
|
||||
ADrawer.SetBrushParams(bsClear, clTAColor);
|
||||
ADrawer.Pen := Pen;
|
||||
if Styles <> nil then
|
||||
Styles.Apply(ADrawer, AStyleIndex);
|
||||
Styles.Apply(ADrawer, AStyleIndex, true);
|
||||
// "true" avoids painting the gaps of non-solid lines in brush color
|
||||
splineStart := 0;
|
||||
splineEnd := -2;
|
||||
while NextNumberSeq(FGraphPoints, splineStart, splineEnd) do begin
|
||||
|
@ -1219,15 +1219,17 @@ var
|
||||
ADrawer.Brush := FBrush;
|
||||
if Styles <> nil then
|
||||
Styles.Apply(ADrawer, AYIndex);
|
||||
|
||||
if fill then begin
|
||||
pts[cnt] := originPt;
|
||||
ADrawer.SetPenParams(psClear, clBlack);
|
||||
ADrawer.Polygon(pts, 0, cnt + 1);
|
||||
end;
|
||||
|
||||
ADrawer.Pen := LinePen;
|
||||
ADrawer.SetBrushParams(bsClear, clTAColor);
|
||||
if Styles <> nil then
|
||||
Styles.Apply(ADrawer, AYIndex);
|
||||
Styles.Apply(ADrawer, AYIndex, true);
|
||||
// "true" avoids painting the gaps of non-solid lines in the brush color
|
||||
ADrawer.PolyLine(pts, 0, cnt);
|
||||
end;
|
||||
|
||||
|
@ -614,7 +614,8 @@ var
|
||||
ADrawer.SetBrushParams(bsClear, clTAColor);
|
||||
ADrawer.Pen := LinePen;
|
||||
if Styles <> nil then
|
||||
Styles.Apply(ADrawer, AIndex);
|
||||
Styles.Apply(ADrawer, AIndex, true);
|
||||
// "true" avoids painting of spaces in non-solid lines in brush color
|
||||
if Depth = 0 then
|
||||
for i := 0 to High(breaks) - 1 do
|
||||
ADrawer.Polyline(points, breaks[i], breaks[i + 1] - breaks[i])
|
||||
|
@ -45,7 +45,7 @@ type
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
destructor Destroy; override;
|
||||
public
|
||||
procedure Apply(ADrawer: IChartDrawer);
|
||||
procedure Apply(ADrawer: IChartDrawer; IgnoreBrush: Boolean = false);
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
published
|
||||
property Brush: TBrush read FBrush write SetBrush;
|
||||
@ -94,7 +94,8 @@ type
|
||||
destructor Destroy; override;
|
||||
public
|
||||
function Add: TChartStyle;
|
||||
procedure Apply(ADrawer: IChartDrawer; AIndex: Cardinal); overload;
|
||||
procedure Apply(ADrawer: IChartDrawer; AIndex: Cardinal;
|
||||
IgnoreBrush: Boolean = false); overload;
|
||||
function StyleByIndex(AIndex: Cardinal): TChartStyle;
|
||||
property Broadcaster: TBroadcaster read FBroadcaster;
|
||||
published
|
||||
@ -119,9 +120,9 @@ end;
|
||||
|
||||
{ TChartStyle }
|
||||
|
||||
procedure TChartStyle.Apply(ADrawer: IChartDrawer);
|
||||
procedure TChartStyle.Apply(ADrawer: IChartDrawer; IgnoreBrush: Boolean = false);
|
||||
begin
|
||||
if UseBrush then
|
||||
if UseBrush and not IgnoreBrush then
|
||||
ADrawer.Brush := Brush;
|
||||
if UseFont then
|
||||
ADrawer.Font := Font;
|
||||
@ -262,13 +263,14 @@ begin
|
||||
Result := TChartStyle(FStyles.Add);
|
||||
end;
|
||||
|
||||
procedure TChartStyles.Apply(ADrawer: IChartDrawer; AIndex: Cardinal);
|
||||
procedure TChartStyles.Apply(ADrawer: IChartDrawer; AIndex: Cardinal;
|
||||
IgnoreBrush: Boolean = false);
|
||||
var
|
||||
style: TChartStyle;
|
||||
begin
|
||||
style := StyleByIndex(AIndex);
|
||||
if style <> nil then
|
||||
style.Apply(ADrawer);
|
||||
style.Apply(ADrawer, IgnoreBrush);
|
||||
end;
|
||||
|
||||
constructor TChartStyles.Create(AOwner: TComponent);
|
||||
|
Loading…
Reference in New Issue
Block a user