On Sat, 26 Sep 2026 13:26:46 GMT, Marius Hanl <[email protected]> wrote:

> The following SVG path does not render and logs a warning instead:
> 
> M11.65,6.47A1.69,1.69 0 0,1 13.34,4.78
> 
> 
> WARNING: Failed to configure svg path "M11.65,6.47A1.69,1.69 0 0,1 
> 13.34,4.78": 0 <= tfrom <= tto <= 1 required
> 
> 
> This is because of a very minor floating point error in arcTo.
> The resulting `dot` is `1.0000000000000002`, `Math.acos(..)` will as a result 
> return `NaN`.
> 
> The fix is to clamp the value so it can never be higher than 1.0.
> 
> Using a size of 64:
> | Before | After |
> |-|-|
> | <img width="302" height="330" alt="image" 
> src="https://github.com/user-attachments/assets/5df4d711-b177-40ed-844f-5b4faddcc145";
>  /> | <img width="302" height="330" alt="image" 
> src="https://github.com/user-attachments/assets/278b80e8-e5e2-48ea-81d8-cf9cdbbc8277";
>  /> |
> | + Warning on Console | - |
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: a281f632
Author:    Marius Hanl <[email protected]>
URL:       
https://git.openjdk.org/jfx/commit/a281f6321f9ea15e68aa306812c73a852b0c4ce6
Stats:     12 lines in 2 files changed: 9 ins; 0 del; 3 mod

8393053: Valid SVG arc path may not render and logs a warning

Reviewed-by: angorya, lkostyra

-------------

PR: https://git.openjdk.org/jfx/pull/2326

Reply via email to