diff --git a/components/tachart/tadrawersvg.pas b/components/tachart/tadrawersvg.pas index 32711c2a10..a0c2ba9307 100644 --- a/components/tachart/tadrawersvg.pas +++ b/components/tachart/tadrawersvg.pas @@ -28,6 +28,7 @@ type TSVGDrawer = class(TBasicDrawer, IChartDrawer) strict private + FAntialiasingMode: TChartAntialiasingMode; FBrushColor: TFPColor; FClippingPathId: Integer; FFont: TFPCustomFont; @@ -80,6 +81,7 @@ type AStartAngle16Deg, AAngleLength16Deg: Integer); procedure Rectangle(const ARect: TRect); procedure Rectangle(AX1, AY1, AX2, AY2: Integer); + procedure SetAntialiasingMode(AValue: TChartAntialiasingMode); procedure SetBrushColor(AColor: TChartColor); procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor); procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor); @@ -151,6 +153,7 @@ end; procedure TSVGDrawer.DrawingBegin(const ABoundingBox: TRect); begin + FAntialiasingMode := amDontCare; with ABoundingBox do WriteFmt( ' amDontCare then + WriteStr(''); WriteStr(''); end; @@ -275,6 +280,19 @@ begin Rectangle(Left, Top, Right, Bottom); end; +procedure TSVGDrawer.SetAntialiasingMode(AValue: TChartAntialiasingMode); +const + AM_TO_CSS: array [amOn .. amOff] of String = + ('geometricPrecision', 'crispEdges'); +begin + if FAntialiasingMode = AValue then exit; + if FAntialiasingMode <> amDontCare then + WriteStr(''); + FAntialiasingMode := AValue; + if FAntialiasingMode <> amDontCare then + WriteFmt('',[AM_TO_CSS[FAntialiasingMode]]); +end; + procedure TSVGDrawer.SetBrush(ABrush: TFPCustomBrush); begin FBrushColor := ABrush.FPColor;