Skip to content

Commit

Permalink
rotate: Improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Nov 19, 2023
1 parent 48ce40b commit 3f19abe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/draw/transformations.typ
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
}

assert(type(mat) == array,
message: "Transformtion matrix must be of type array. Got " + repr(mat))
message: "Transformtion matrix must be of type array, got: " + repr(mat))
assert.eq(mat.len(), 4,
message: "Transformation matrix must be of size 4x4")
message: "Transformation matrix must be of size 4x4, got: " + repr(mat))

(ctx => {
ctx.transform = mat
Expand All @@ -28,7 +28,8 @@

#let rotate(..angles) = {
assert(angles.pos().len() == 1 or angles.named().len() > 0,
message: "Rotate takes a single z-angle or angles (x, y, z or yaw, pitch, roll) as named arguments")
message: "Rotate takes a single z-angle or angles " +
"(x, y, z or yaw, pitch, roll) as named arguments, got: " + repr(angles))

let named = angles.named()
let names = named.keys()
Expand Down

0 comments on commit 3f19abe

Please sign in to comment.