#1 2021-02-07 15:51:36

PaulMc
Member
Registered: 2021-02-07
Posts: 1

Paths not rendering correctly in some cases.

It's a fill path issue uncovered when trying to print SVG paths. After a bit of debugging I managed to isolate it to this function in SynPDF:

function EnumEMFFunc(DC: HDC; var Table: THandleTable; r: PEnhMetaRecord;
  NumObjects: dword; e: TPdfEnum): LongBool; stdcall;

This section is incorrectly filling some paths:

      EMR_FILLPATH:
        begin
          if not brush.null then
          begin
            e.FillColor := brush.Color;
            e.Canvas.Fill;
          end;
          e.Canvas.NewPath;
          e.Canvas.FNewPath := false;
        end;

Replacing it with the following enables it to work correctly in my test cases:

      EMR_FILLPATH:
        begin
          if not brush.null then
          begin
            e.FillColor := brush.Color;
            if PolyFillMode = ALTERNATE then //
              e.Canvas.EoFill //
            else //
              e.Canvas.Fill;
          end;
          e.Canvas.NewPath;
          e.Canvas.FNewPath := false;
        end;

Last edited by PaulMc (2021-02-07 15:56:20)

Offline

Board footer

Powered by FluxBB