andlabs / andlabs/libui

Arcs aren't drawn correctly on Windows 10, if sweep is negative

Open
#411 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
10.9k
Forks
612
PR merge metrics
No merged PRs in 30d

Description

Positive sweeps:

![Positive sweep looks right](https://i.imgur.com/gylJ70t.png)

But when changing drawtests.c as below...

```Diff
@@ -161,7 +161,7 @@ static void drawArcs(uiAreaDrawParams *p)

path = uiDrawNewPath(uiDrawFillModeWinding);

- add = (2.0 * uiPi) / 12;
+ add = -(2.0 * uiPi) / 12;

x = start + rad;
y = start + rad;
```

...we get negative sweeps resulting in this:

![Negative not so much](https://i.imgur.com/1ORzriA.png)

Same change on Linux:

![Good on Linux](https://i.imgur.com/vlsyr2p.png)

Contributor guide

Open the contributing guide

Research direction

Start with drawtests.c and reproduce the arc example on Windows 10 using the negative value for add, then compare it with the Linux result. Trace the libui drawing path used by the test and identify where negative sweeps are rendered differently; done means the negative-sweep arcs match the expected Linux behavior on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
computer-graphics, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.