enthought / enthought/enable

Discrepancies in `arc_to` paths

Open
#985 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
97
Forks
45
PR merge metrics
No merged PRs in 30d

Description

When drawing a rounded rect using methods like the following:
```
def gen_rounded_rect_ccw(obj, x, y, w, h, r):
obj.move_to(x + w/2, y)
obj.arc_to(x + w, y, x + w, y + h/2, r)
obj.arc_to(x + w, y + h, x + w / 2, y + h, r)
obj.arc_to(x, y + h, x, y + h/2, r)
obj.arc_to(x, y, x + w / 2, y, r)

def gen_rounded_rect_cw(obj, x, y, w, h, r):
obj.move_to(x + w/2, y)
obj.arc_to(x, y, x, y + h / 2, r)
obj.arc_to(x, y + h, x + w / 2, y + h, r)
obj.arc_to(x + w, y + h, x + w, y + h / 2, r)
obj.arc_to(x + w, y, x + w / 2, y, r)
```
sometimes Kiva draws the entire boundary (eg. celiagg, qpainter, pdf backends):
![image](https://user-images.githubusercontent.com/600761/183447151-b1649a4f-d764-40d6-9b6b-10fb772b94a4.png)

and sometimes it does not (eg. agg, opengl, quartz backends):
![image](https://user-images.githubusercontent.com/600761/183447248-da058e36-8b95-4ca3-8ffd-aba0c112726b.png)

I think given that the end point of the paths is the same as the start point, I think the first case is the correct one.

Also the PS and SVG backends fail completely to render (because `basecore2d.GraphicsContext` doesn't implement `arc_to`).

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.