draw rectangle glitches

Bug #427866 reported by moaxey
6
This bug affects 1 person
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 @@
         linear.add_color_stop_rgb(1,color[0],color[1],color[2])
         cr.set_source(linear)

- 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(x0+5,y0,x1-x0-10,y1-y0)
- cr.rectangle(x0,y0+5,x1-x0,y1-y0-10)
+ 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):

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.