enthought / enthought/enable

Kiva Agg renderer's top-left origin support doesn't work

Open
#582 0 comments 0 reactions 0 assignees View on GitHub
priority: low type: bug
Dominant language
C
Stars
97
Forks
45
PR merge metrics
No merged PRs in 30d

Description

`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:
```python
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')
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.