PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

First transparent item is rendered white
https://forum.pdfsharp.net/viewtopic.php?f=3&t=1181
Page 1 of 1

Author:  moe [ Wed May 12, 2010 11:47 am ]
Post subject:  First transparent item is rendered white

If the first Item I draw is a transparent Item (in my case a rectangle and I know, it makes not much sense but I parse the color myself and don't want check for trancparency myself) following statement failes because it is not recogniced that this.realizedFillColor is initialized with XColor.Empty and I get a white item rendered:

in PdfGraphicsState.cs method RealizeBrush:
Code:
if ( this.renderer.Owner.Version >= 14 && this.realizedFillColor.A != color.A )



I fixed it for me with:

Code:
if (    this.renderer.Owner.Version >= 14
            &&  (this.realizedFillColor == XColor.Empty || this.realizedFillColor.A != color.A ) )


but I'm not shure if this is a clean enought. Could you have a look at it please.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/