Merged revision(s) 51266 #a9f558b56b, 51307 #dde0721065 from trunk:

TAChart: Add "ResetFont" to drawing interface to fix issue #27163 without interfering with nogui widgetset.
........
TAChart: Add missing "ResetFont" for TAggpasDrawer forgotten in r51266 #a9f558b56b
........

git-svn-id: branches/fixes_1_6@51327 -
This commit is contained in:
maxim 2016-01-18 23:01:48 +00:00
parent 61158d5456
commit 915e906be0
9 changed files with 44 additions and 9 deletions

View File

@ -56,6 +56,7 @@ type
AStartAngle16Deg, AAngleLength16Deg: Integer);
procedure Rectangle(const ARect: TRect);
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
procedure ResetFont;
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
@ -196,6 +197,11 @@ begin
FCanvas.Rectangle(ARect);
end;
procedure TAggPasDrawer.ResetFont;
begin
FCanvas.Font.Orientation := 0;
end;
procedure TAggPasDrawer.SetBrush(ABrush: TFPCustomBrush);
begin
with FCanvas.Brush do begin

View File

@ -60,6 +60,7 @@ type
AStartAngle16Deg, AAngleLength16Deg: Integer);
procedure Rectangle(const ARect: TRect);
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
procedure ResetFont;
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
@ -214,6 +215,11 @@ begin
Rectangle(Left, Top, Right, Bottom)
end;
procedure TBGRABitmapDrawer.ResetFont;
begin
Canvas.Font.Orientation := 0;
end;
procedure TBGRABitmapDrawer.SetAntialiasingMode(AValue: TChartAntialiasingMode);
begin
Canvas.AntialiasingMode := TAntialiasingMode(AValue);

View File

@ -65,6 +65,7 @@ type
AStartAngle16Deg, AAngleLength16Deg: Integer);
procedure Rectangle(const ARect: TRect);
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
procedure ResetFont;
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
@ -264,6 +265,11 @@ begin
GetCanvas.Rectangle(ARect);
end;
procedure TCanvasDrawer.ResetFont;
begin
GetCanvas.Font.Orientation := 0;
end;
procedure TCanvasDrawer.SetAntialiasingMode(AValue: TChartAntialiasingMode);
begin
GetCanvas.AntialiasingMode := TAntialiasingMode(AValue);

View File

@ -65,6 +65,7 @@ type
AStartAngle16Deg, AAngleLength16Deg: Integer);
procedure Rectangle(const ARect: TRect);
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
procedure ResetFont;
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
@ -231,6 +232,11 @@ begin
FCanvas.Rectangle(ARect);
end;
procedure TFPCanvasDrawer.ResetFont;
begin
FCanvas.Font.Orientation := 0;
end;
procedure TFPCanvasDrawer.SetBrush(ABrush: TFPCustomBrush);
begin
AssignFPCanvasHelper(FCanvas.Brush, ABrush);

View File

@ -68,6 +68,7 @@ type
AStartAngle16Deg, AAngleLength16Deg: Integer);
procedure Rectangle(const ARect: TRect);
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
procedure ResetFont;
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
@ -303,6 +304,11 @@ begin
Rectangle(Left, Top, Right, Bottom);
end;
procedure TFPVectorialDrawer.ResetFont;
begin
FFont.Orientation := 0;
end;
procedure TFPVectorialDrawer.SetBrush(ABrush: TFPCustomBrush);
begin
if ABrush is TBrush then

View File

@ -61,6 +61,7 @@ type
AStartAngle16Deg, AAngleLength16Deg: Integer);
procedure Rectangle(const ARect: TRect);
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
procedure ResetFont;
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
@ -254,6 +255,10 @@ begin
Rectangle(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom);
end;
procedure TOpenGLDrawer.ResetFont;
begin
end;
procedure TOpenGLDrawer.SetAntialiasingMode(AValue: TChartAntialiasingMode);
begin
case AValue of

View File

@ -89,6 +89,7 @@ type
AStartAngle16Deg, AAngleLength16Deg: Integer);
procedure Rectangle(const ARect: TRect);
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
procedure ResetFont;
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
procedure SetBrushColor(AColor: TChartColor);
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
@ -378,6 +379,11 @@ begin
Rectangle(Left, Top, Right, Bottom);
end;
procedure TSVGDrawer.ResetFont;
begin
FFont.Orientation := 0;
end;
procedure TSVGDrawer.SetAntialiasingMode(AValue: TChartAntialiasingMode);
const
AM_TO_CSS: array [amOn .. amOff] of String =

View File

@ -90,6 +90,7 @@ type
AStartAngle16Deg, AAngleLength16Deg: Integer);
procedure Rectangle(const ARect: TRect);
procedure Rectangle(AX1, AY1, AX2, AY2: Integer);
procedure ResetFont;
function Scale(ADistance: Integer): Integer;
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
procedure SetBrushColor(AColor: TChartColor);

View File

@ -817,7 +817,6 @@ procedure TChart.Draw(ADrawer: IChartDrawer; const ARect: TRect);
var
ldd: TChartLegendDrawingData;
s: TBasicChartSeries;
fnt: TFont;
begin
Prepare;
@ -882,14 +881,8 @@ begin
// Undo changes made by the drawer (mainly for printing). The user may print
// something else after the chart and, for example, would not expect the font
// to be rotated.
// (Workaround for issue #0027163)
fnt := TFont.Create; // to effectively reset font orientation
try
ADrawer.Font := fnt;
finally
fnt.Free;
end;
// to be rotated (Fix for issue #0027163)
ADrawer.ResetFont;
ADrawer.SetPenParams(psSolid, clDefault);
ADrawer.SetBrushParams(bsSolid, clWhite);
ADrawer.SetAntialiasingMode(amDontCare);