draw rectangle glitches
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cairo Plot |
New
|
Undecided
|
Unassigned |
Bug Description
When the blocks in gantt chart are small, the rectangles drawn do not render correctly.
Looking at the code, drawing of the rectangles in unnecessarily complex. Instead of drawing four joined circles and two rectangles, just the corner arcs can be drawn, creating simpler artwork.
here's a patch (based on fresh checkout as dated)
--- CairoPlot.py~ 2009-09-11 22:30:20.000000000 +1000
+++ CairoPlot.py 2009-09-11 23:01:36.000000000 +1000
@@ -948,12 +948,10 @@
- cr.arc(x0+5, y0+5, 5, 0, 2*math.pi)
- cr.arc(x1-5, y0+5, 5, 0, 2*math.pi)
- cr.arc(x0+5, y1-5, 5, 0, 2*math.pi)
- cr.arc(x1-5, y1-5, 5, 0, 2*math.pi)
- cr.rectangle(
- cr.rectangle(
+ cr.arc(x0+5, y0+5, 5, 1*math.pi, 1.5*math.pi)
+ cr.arc(x1-5, y0+5, 5, 1.5*math.pi, 2*math.pi)
+ cr.arc(x1-5, y1-5, 5, 0, 0.5*math.pi)
+ cr.arc(x0+5, y1-5, 5, 0.5*math.pi, 1*math.pi)
cr.fill()
def draw_shadow(self, x0, y0, x1, y1):