View Issue Details

IDProjectCategoryView StatusLast Update
0032449FPCPatchpublic2017-09-20 19:52
ReporterPascal RiekenbergAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindows 10 x64OS Version1703
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0032449: fcl-report: image exporter produces slight distortion
DescriptionSee attached demos and patch.
TagsNo tags attached.
Fixed in Revision37270.
FPCOldBugId
FPCTarget
Attached Files
  • fpreportcanvashelper.pp.patch (1,133 bytes)
    Index: packages/fcl-report/src/fpreportcanvashelper.pp
    ===================================================================
    --- packages/fcl-report/src/fpreportcanvashelper.pp	(revision 37254)
    +++ packages/fcl-report/src/fpreportcanvashelper.pp	(working copy)
    @@ -77,8 +77,8 @@
     begin
       Result.Left:=mmToPixels(APos.Left);
       Result.Top:=mmToPixels(APos.Top);
    -  Result.Right:=mmToPixels(APos.Left+AWidth);
    -  Result.Bottom:=mmToPixels(APos.Top+AHeight);
    +  Result.Right:=mmToPixels(APos.Left+AWidth)-1;
    +  Result.Bottom:=mmToPixels(APos.Top+AHeight)-1;
     end;
     
     function TFPReportCanvasHelper.CoordToPoint(const APos: TFPReportPoint;
    @@ -132,6 +132,10 @@
       Canvas.Pen.FPColor:=ColorToRGBTriple(TFPReportShape(AShape).Color);
       Canvas.Pen.Style:=psSolid;
       Canvas.Pen.Width:=1;
    +  { exit if Shape will not be visible. }
    +  if (TFPReportShape(AShape).Color = clNone)
    +  or (TFPReportShape(AShape).Color = TFPReportShape(AShape).Frame.BackgroundColor) then
    +    exit;
       case TFPReportShape(AShape).ShapeType of
         stEllipse: RenderShapeEllipse(lpt1,AShape.RTLayout);
         stCircle: RenderShapeCircle(lpt1,AShape.RTLayout);
    
  • old.png (103,081 bytes)
    old.png (103,081 bytes)
  • new.png (102,813 bytes)
    new.png (102,813 bytes)

Activities

Pascal Riekenberg

2017-09-20 14:50

reporter  

fpreportcanvashelper.pp.patch (1,133 bytes)
Index: packages/fcl-report/src/fpreportcanvashelper.pp
===================================================================
--- packages/fcl-report/src/fpreportcanvashelper.pp	(revision 37254)
+++ packages/fcl-report/src/fpreportcanvashelper.pp	(working copy)
@@ -77,8 +77,8 @@
 begin
   Result.Left:=mmToPixels(APos.Left);
   Result.Top:=mmToPixels(APos.Top);
-  Result.Right:=mmToPixels(APos.Left+AWidth);
-  Result.Bottom:=mmToPixels(APos.Top+AHeight);
+  Result.Right:=mmToPixels(APos.Left+AWidth)-1;
+  Result.Bottom:=mmToPixels(APos.Top+AHeight)-1;
 end;
 
 function TFPReportCanvasHelper.CoordToPoint(const APos: TFPReportPoint;
@@ -132,6 +132,10 @@
   Canvas.Pen.FPColor:=ColorToRGBTriple(TFPReportShape(AShape).Color);
   Canvas.Pen.Style:=psSolid;
   Canvas.Pen.Width:=1;
+  { exit if Shape will not be visible. }
+  if (TFPReportShape(AShape).Color = clNone)
+  or (TFPReportShape(AShape).Color = TFPReportShape(AShape).Frame.BackgroundColor) then
+    exit;
   case TFPReportShape(AShape).ShapeType of
     stEllipse: RenderShapeEllipse(lpt1,AShape.RTLayout);
     stCircle: RenderShapeCircle(lpt1,AShape.RTLayout);

Pascal Riekenberg

2017-09-20 14:50

reporter  

old.png (103,081 bytes)
old.png (103,081 bytes)

Pascal Riekenberg

2017-09-20 14:51

reporter  

new.png (102,813 bytes)
new.png (102,813 bytes)

Michael Van Canneyt

2017-09-20 17:03

administrator   ~0102949

Well spotted, thank you for the patch!

Issue History

Date Modified Username Field Change
2017-09-20 14:50 Pascal Riekenberg New Issue
2017-09-20 14:50 Pascal Riekenberg File Added: fpreportcanvashelper.pp.patch
2017-09-20 14:50 Pascal Riekenberg File Added: old.png
2017-09-20 14:51 Pascal Riekenberg File Added: new.png
2017-09-20 17:02 Michael Van Canneyt Fixed in Revision => 37270.
2017-09-20 17:02 Michael Van Canneyt Status new => resolved
2017-09-20 17:02 Michael Van Canneyt Resolution open => fixed
2017-09-20 17:02 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-09-20 17:03 Michael Van Canneyt Note Added: 0102949
2017-09-20 17:03 Michael Van Canneyt Fixed in Version => 3.1.1
2017-09-20 17:03 Michael Van Canneyt Target Version => 3.2.0
2017-09-20 19:52 Pascal Riekenberg Status resolved => closed