TAChart: Fix SIGFPE after changing scale to logarithmic on zoomed-in chart

git-svn-id: trunk@25941 -
This commit is contained in:
ask 2010-06-06 06:02:04 +00:00
parent 68caa0b7e3
commit 3fb76f8c86
3 changed files with 12 additions and 4 deletions

View File

@ -652,8 +652,13 @@ end;
procedure TChartAxis.StyleChanged(ASender: TObject);
begin
Unused(ASender);
(Collection.Owner as TCustomChart).Invalidate;
with Collection.Owner as TCustomChart do begin
// Transformation change could have invalidated the current extent,
// so revert to full extent for now.
if ASender is TAxisTransform then
ZoomFull;
Invalidate;
end;
end;
const

View File

@ -236,7 +236,7 @@ type
procedure SaveToBitmapFile(const AFileName: String); inline;
procedure SaveToFile(AClass: TRasterImageClass; const AFileName: String);
function SaveToImage(AClass: TRasterImageClass): TRasterImage;
procedure ZoomFull;
procedure ZoomFull; override;
public // Coordinate conversion
function GraphToImage(const AGraphPoint: TDoublePoint): TPoint;
function ImageToGraph(const APoint: TPoint): TDoublePoint;

View File

@ -41,7 +41,10 @@ const
DEF_TITLE_DISTANCE = 4;
type
TCustomChart = class(TCustomControl);
TCustomChart = class(TCustomControl)
public
procedure ZoomFull; virtual; abstract;
end;
{ TChartPen }