Hello,
Fix #1:
I think I have found a fix for ticket #25.
http://www.lorenzogil.com/projects/pycha/ticket/25
When stroke shadow is true and stroke hide is true, the last bar gets
set to a different color (actually, the last bar is the same color,
but all the other bars become darker). The cause of this is
fill_preserve(). In bar.py line 83:
if self.options.shouldFill or (not self.options.stroke.hide):
cx.rectangle(x, y, w, h)
if self.options.shouldFill:
cx.set_source_rgb(*self.options.colorScheme
[
bar.name])
cx.fill_preserve()
fill_preserve() is used to keep the path for the optional stroke, but
it somehow changes the colors of the bars. The fix is to just use fill
() and then remake the rectangle before we stroke.
if self.options.shouldFill or (not self.options.stroke.hide):
cx.rectangle(x, y, w, h)
if self.options.shouldFill:
cx.set_source_rgb(*self.options.colorScheme
[
bar.name])
cx.fill()
if not self.options.stroke.hide:
cx.rectangle(x, y, w, h) # remake the rectangle
cx.set_source_rgb(*hex2rgb
(self.options.stroke.color))
cx.stroke()
I'm not a cairo expert, so there might be a better way to fix this.
Fix #2:
Somewhat related to the above, the stroke shadow option doesn't
actually draw a shadow. In bar.py, the _getShadowRectangle method
returns a slightly bigger rectangle:
return (x-2, y-2, w+4, h+2)
but this is invisible to the naked eye. Changing it to:
def _getShadowRectangle(self, x, y, w, h):
return ((x+(w/5.0)), (y-(w/10.0)), w, (h+(w/10.0)))
scales the shadow to the rectangle so that it's visible.
http://pycha.googlegroups.com/web/shadow-fixed.png
I'll make a patch if the above sounds ok.
Adam