shape.arc: Prevent an angle underflow when rounded edges are enabled.
Fixes #2604
This commit is contained in:
parent
e8bf75ef3c
commit
9efcf9df87
|
@ -472,8 +472,11 @@ function module.arc(cr, width, height, thickness, start_angle, end_angle, start_
|
||||||
if end_rounded then
|
if end_rounded then
|
||||||
arc_length = arc_length - thickness/2
|
arc_length = arc_length - thickness/2
|
||||||
|
|
||||||
-- And back to angles
|
-- And back to angles. Also make sure to avoid underflowing when the
|
||||||
end_angle = start_angle + (arc_length/(radius - thickness/2))
|
-- rounded edge radius is greater than the angle delta.
|
||||||
|
end_angle = start_angle + math.max(
|
||||||
|
0, arc_length/(radius - thickness/2)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The path is a curcular arc joining 4 points
|
-- The path is a curcular arc joining 4 points
|
||||||
|
|
Loading…
Reference in New Issue