You've already forked lazarus-ccr
fpspreadsheet: Fix Brush.Bitmap not being cleared in next redraw of the chart.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9057 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -22,8 +22,9 @@ uses
|
|||||||
// LCL
|
// LCL
|
||||||
LCLVersion, Forms, Controls, Graphics, GraphUtil, Dialogs,
|
LCLVersion, Forms, Controls, Graphics, GraphUtil, Dialogs,
|
||||||
// TAChart
|
// TAChart
|
||||||
TATypes, TATextElements, TAChartUtils, TALegend, TACustomSource, TASources,
|
TATypes, TATextElements, TAChartUtils, TADrawUtils, TALegend,
|
||||||
TACustomSeries, TASeries, TARadialSeries, TAFitUtils, TAFuncSeries, TAMultiSeries,
|
TACustomSource, TASources, TACustomSeries, TASeries, TARadialSeries,
|
||||||
|
TAFitUtils, TAFuncSeries, TAMultiSeries,
|
||||||
TAChartAxisUtils, TAChartAxis, TAStyles, TAGraph,
|
TAChartAxisUtils, TAChartAxis, TAStyles, TAGraph,
|
||||||
// FPSpreadsheet
|
// FPSpreadsheet
|
||||||
fpsTypes, fpSpreadsheet, fpsUtils, fpsChart,
|
fpsTypes, fpSpreadsheet, fpsUtils, fpsChart,
|
||||||
@ -109,12 +110,15 @@ type
|
|||||||
FWorkbook: TsWorkbook;
|
FWorkbook: TsWorkbook;
|
||||||
FWorkbookChartIndex: Integer;
|
FWorkbookChartIndex: Integer;
|
||||||
FBrushBitmaps: TFPObjectList;
|
FBrushBitmaps: TFPObjectList;
|
||||||
|
FSavedAfterDraw: TChartDrawEvent;
|
||||||
procedure SetChart(AValue: TChart);
|
procedure SetChart(AValue: TChart);
|
||||||
procedure SetWorkbookChartIndex(AValue: Integer);
|
procedure SetWorkbookChartIndex(AValue: Integer);
|
||||||
procedure SetWorkbookSource(AValue: TsWorkbookSource);
|
procedure SetWorkbookSource(AValue: TsWorkbookSource);
|
||||||
|
|
||||||
//procedure FitSeriesFitEquationText(ASeries: TFitSeries; AEquationText: IFitEquationText);
|
//procedure FitSeriesFitEquationText(ASeries: TFitSeries; AEquationText: IFitEquationText);
|
||||||
|
|
||||||
|
procedure AfterDrawChartHandler(ASender: TChart; ADrawer: IChartDrawer);
|
||||||
|
|
||||||
protected
|
protected
|
||||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
|
|
||||||
@ -1106,6 +1110,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TsWorkbookChartLink.AfterDrawChartHandler(ASender: TChart;
|
||||||
|
ADrawer: IChartDrawer);
|
||||||
|
begin
|
||||||
|
if FSavedAfterDraw <> nil then
|
||||||
|
FSavedAfterDraw(ASender, ADrawer);
|
||||||
|
|
||||||
|
{ TCanvasDrawer.SetBrushParams does not remove the Brush.Bitmap when then
|
||||||
|
Brush.Style does not change. Since Brush.Style will be reset to bsSolid
|
||||||
|
in the last statement of TChart.Draw this will be enforced by setting
|
||||||
|
Brush.Style to bsClear here. }
|
||||||
|
ADrawer.SetBrushParams(bsClear, clTAColor);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TsWorkbookChartLink.ClearChart;
|
procedure TsWorkbookChartLink.ClearChart;
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
@ -1394,6 +1411,12 @@ begin
|
|||||||
if FChart = AValue then
|
if FChart = AValue then
|
||||||
exit;
|
exit;
|
||||||
FChart := AValue;
|
FChart := AValue;
|
||||||
|
if FChart <> nil then
|
||||||
|
begin
|
||||||
|
FSavedAfterDraw := FChart.OnAfterDraw;
|
||||||
|
FChart.OnAfterDraw := @AfterDrawChartHandler;
|
||||||
|
end else
|
||||||
|
FSavedAfterDraw := nil;
|
||||||
UpdateChart;
|
UpdateChart;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user