aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-08-28 22:52:17 +0200
committerbptato <nincsnevem662@gmail.com>2023-08-28 22:54:27 +0200
commit2c6dc1da4c5efc7d4ca5a004fe084454d94b65c8 (patch)
tree34cf9a82cd2e230763a48f19c0fe4bfe1e6e8e7f /src
parent2b704de41587af20441106fab264c06868559ab9 (diff)
downloadchawan-2c6dc1da4c5efc7d4ca5a004fe084454d94b65c8.tar.gz
path: remove ellipseLines
It was unused. (Or more precisely, indefinitely not implemented. TODO: implement it one day.)
Diffstat (limited to 'src')
-rw-r--r--src/img/path.nim26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/img/path.nim b/src/img/path.nim
index deeeb8c4..0841278c 100644
--- a/src/img/path.nim
+++ b/src/img/path.nim
@@ -181,32 +181,6 @@ iterator arcLines(p0, p1, o: Vector2D, r: float64, i: bool): Line {.inline.} =
p0 = p1
theta -= step
-# From SerenityOS
-iterator ellipseLines(p0, p1, o: Vector2D, rx, ry, theta_1, rotx,
- theta_delta: float64): Line {.inline.} =
- if rx > 0 and ry > 0:
- var s = p0
- var e = p1
- var theta_1 = theta_1
- var theta_delta = theta_delta
- if theta_delta < 0:
- swap(s, e)
- theta_1 += theta_delta
- theta_delta = abs(theta_delta)
- # The segments are at most 1 long
- let step = arctan2(1f64, max(rx, ry))
- var current_point = s - o
- var next_point = Vector2D()
- var theta = theta_1
- while theta <= theta_1 + theta_delta:
- next_point.x = rx * cos(theta)
- next_point.y = ry * sin(theta)
- next_point = next_point.rotate(rotx)
- yield Line(p0: current_point + o, p1: next_point + o)
- current_point = next_point
- theta += step
- yield Line(p0: current_point + o, p1: e)
-
iterator lines(subpath: Subpath, i: int): Line {.inline.} =
let p0 = subpath.points[i]
let p1 = subpath.points[i + 1]