Text bug in Hieroglyph 1.2

Since I haven't found out how to report bugs for this package, I am posting this here. Changing the color of Text elements in a Hieroglyph image like this: text {attributes = plain {strokeRGBA = opaque blue}} does not work correctly. Instead, the color used for the text is the one of the previously drawn element. With the little knowledge I have about cairo, it seems that the bug is in the renderPrimitive function in Cairo.hs where the order of Cairo.setSourceRGBA and Cairo.showText is wrong. Something like this seems to work: renderPrimitive _ s0 (Text str (Point ox oy) state) = do applyAttributeDelta s0 state Cairo.moveTo ox oy let (sr,sg,sb,sa) = colourToTuple . strokeRGBA $ state when (outlined state) $ Cairo.setSourceRGBA sr sg sb sa Cairo.showText str when (clipped state) $ Cairo.clip return state By the way, for the complete newbie that I am, is there a standard way to report bugs for a package from Hackage? Danny

On Thu, Mar 19, 2009 at 08:58:08AM +0000, Danny Chan wrote:
By the way, for the complete newbie that I am, is there a standard way to report bugs for a package from Hackage?
Most packages on Hackage have a 'Maintainer' field providing an email address to which you can send bug reports. Although I see that in this particular case, Jeff Heard did not list an email address in the Maintainer field for Hieroglyph. -Brent

No? Well, that's a bug in and of itself.
On Thu, Mar 19, 2009 at 9:50 AM, Brent Yorgey
On Thu, Mar 19, 2009 at 08:58:08AM +0000, Danny Chan wrote:
By the way, for the complete newbie that I am, is there a standard way to report bugs for a package from Hackage?
Most packages on Hackage have a 'Maintainer' field providing an email address to which you can send bug reports. Although I see that in this particular case, Jeff Heard did not list an email address in the Maintainer field for Hieroglyph.
-Brent
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Danny, I'll fix this today and repost and add a maintainer email
address in the cabal package while I'm at it. Thanks!
2009/3/19 Danny Chan
Since I haven't found out how to report bugs for this package, I am posting this here.
Changing the color of Text elements in a Hieroglyph image like this:
text {attributes = plain {strokeRGBA = opaque blue}}
does not work correctly. Instead, the color used for the text is the one of the previously drawn element. With the little knowledge I have about cairo, it seems that the bug is in the renderPrimitive function in Cairo.hs where the order of Cairo.setSourceRGBA and Cairo.showText is wrong. Something like this seems to work:
renderPrimitive _ s0 (Text str (Point ox oy) state) = do applyAttributeDelta s0 state Cairo.moveTo ox oy let (sr,sg,sb,sa) = colourToTuple . strokeRGBA $ state when (outlined state) $ Cairo.setSourceRGBA sr sg sb sa Cairo.showText str when (clipped state) $ Cairo.clip return state
By the way, for the complete newbie that I am, is there a standard way to report bugs for a package from Hackage?
Danny
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Bug fixed. Package uploaded to Hackage.
2009/3/19 Danny Chan
Since I haven't found out how to report bugs for this package, I am posting this here.
Changing the color of Text elements in a Hieroglyph image like this:
text {attributes = plain {strokeRGBA = opaque blue}}
does not work correctly. Instead, the color used for the text is the one of the previously drawn element. With the little knowledge I have about cairo, it seems that the bug is in the renderPrimitive function in Cairo.hs where the order of Cairo.setSourceRGBA and Cairo.showText is wrong. Something like this seems to work:
renderPrimitive _ s0 (Text str (Point ox oy) state) = do applyAttributeDelta s0 state Cairo.moveTo ox oy let (sr,sg,sb,sa) = colourToTuple . strokeRGBA $ state when (outlined state) $ Cairo.setSourceRGBA sr sg sb sa Cairo.showText str when (clipped state) $ Cairo.clip return state
By the way, for the complete newbie that I am, is there a standard way to report bugs for a package from Hackage?
Danny
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Brent Yorgey
-
Danny Chan
-
Jeff Heard