utelle / wxpdfdoc

wxPdfDocument - Generation of PDF documents from wxWidgets applications
http://utelle.github.io/wxpdfdoc/
Other
70 stars 27 forks source link

wxPdfDC: wxTRANSPARENT_PEN not supported in some cases #55

Closed pele65 closed 5 years ago

pele65 commented 5 years ago

When drawing on a wxPdfDC, the pen and the brush may be transparent at the same time. In this case the drawing operation shall be no operation. But in fact the drawing in your sample is invisible on the screen only. In the pdf the element is drawn in black colour. This happens because the wxPdfDocument drawing style wxPDF_STYLE_NOOP is not handled properly. Maybe in each drawing operation in wxPdfDocument there should just be a quick return if wxPDF_STYLE_NOOP is given.

Test code:

    dc.SetPen( *wxTRANSPARENT_PEN );
    dc.SetBrush( *wxTRANSPARENT_BRUSH );
    dc.DrawEllipse(50, 140, 100, 50);
utelle commented 5 years ago

Commit 48af68eb8aca7749285750d00ccd8f86e531fd47 hopefully fixes this issue.

pele65 commented 5 years ago

As far as I tested the code, everything is ok now. There may be a difference when drawing a point or a spline with transparent pen. But this is too exotic even for me (at the moment ;-) ) My use is creating maps, sometimes with invisible marks to force borders in a bounding box.