enable
enable copied to clipboard
Kiva Agg renderer's top-left origin support doesn't work
kiva.agg.GraphicsContextArray.__init__
has a bottom_up
keyword argument which defaults to 1, because kiva's coordinate system has its origin in the bottom-left corner. However, passing bottom_up=0
doesn't appear to alter drawing in any way.
Minimal example:
from kiva.image import GraphicsContext
def draw(gc):
gc.set_line_width(3.0)
# green rect
gc.set_stroke_color((0.0, 1.0, 0.0, 1.0))
gc.rect(100, 42, 50, 50)
gc.stroke_path()
# red rect
gc.set_stroke_color((1.0, 0.0, 0.0, 1.0))
gc.rect(100, 420, 50, 50)
gc.stroke_path()
gc = GraphicsContext((800, 600), bottom_up=0)
draw(gc)
gc.save('topleft.png')
gc = GraphicsContext((800, 600), bottom_up=1)
draw(gc)
gc.save('bottomleft.png')