Refactor arc drawing

This commit is contained in:
jgk
2021-06-24 13:34:11 +02:00
parent 9f1b501388
commit 45194273e5
6 changed files with 36 additions and 24 deletions
+9 -1
View File
@@ -225,7 +225,15 @@ arc startA endA rad = thickArc startA endA rad 1
thickArc :: Float -> Float -> Float -> Float -> Picture
{-# INLINE thickArc #-}
thickArc = ThickArc 0
thickArc startA endA rad wdth
| endA - startA > pi = pictures
[ thickArc (startA + pi) endA rad wdth
, ThickArc 0 startA (startA + pi) r w
]
| otherwise = ThickArc 0 startA endA r w
where
r = rad + 0.5 * wdth
w = 1 - wdth / r
withAlpha :: Float -> RGBA -> RGBA
{-# INLINE withAlpha #-}