[Haskell-cafe] Text bug in Hieroglyph 1.2
Danny Chan
chan_dhf at yahoo.de
Thu Mar 19 04:58:08 EDT 2009
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090319/f0cf7301/attachment.htm
More information about the Haskell-Cafe
mailing list