diff options
author | bptato <nincsnevem662@gmail.com> | 2024-01-11 19:39:56 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-01-11 19:39:56 +0100 |
commit | b7570a38b70059fbb9a3fb3d32df153ad5f9706f (patch) | |
tree | 0bcb774fd862afa92944268636d11d3b08f0cd7b /src/img | |
parent | 091764fd976831e0b6d86f4e364dceb4e9c1114f (diff) | |
download | chawan-b7570a38b70059fbb9a3fb3d32df153ad5f9706f.tar.gz |
Use errDOMException template everywhere
Diffstat (limited to 'src/img')
-rw-r--r-- | src/img/path.nim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/img/path.nim b/src/img/path.nim index a1ef9cb7..61c71888 100644 --- a/src/img/path.nim +++ b/src/img/path.nim @@ -305,8 +305,8 @@ proc arcTo*(path: Path, x1, y1, x2, y2, radius: float64): Err[DOMException] = if classify(v) in {fcInf, fcNegInf, fcNan}: return ok() if radius < 0: - return err(newDOMException("Expected positive radius, but got negative", - "IndexSizeError")) + return errDOMException("Expected positive radius, but got negative", + "IndexSizeError") path.ensureSubpath(x1, y1) #TODO this should be transformed by the inverse of the transformation matrix let v0 = path.subpaths[^1].points[^1] @@ -352,8 +352,8 @@ proc arc*(path: Path, x, y, radius, startAngle, endAngle: float64, if classify(v) in {fcInf, fcNegInf, fcNan}: return ok() if radius < 0: - return err(newDOMException("Expected positive radius, but got negative", - "IndexSizeError")) + return errDOMException("Expected positive radius, but got negative", + "IndexSizeError") let o = Vector2D(x: x, y: y) var s = resolveEllipsePoint(o, startAngle, radius, radius, 0) var e = resolveEllipsePoint(o, endAngle, radius, radius, 0) @@ -374,8 +374,8 @@ proc ellipse*(path: Path, x, y, radiusX, radiusY, rotation, startAngle, if classify(v) in {fcInf, fcNegInf, fcNan}: return ok() if radiusX < 0 or radiusY < 0: - return err(newDOMException("Expected positive radius, but got negative", - "IndexSizeError")) + return errDOMException("Expected positive radius, but got negative", + "IndexSizeError") let o = Vector2D(x: x, y: y) var s = resolveEllipsePoint(o, startAngle, radiusX, radiusY, rotation) var e = resolveEllipsePoint(o, endAngle, radiusX, radiusY, rotation) |