creative-scala
creative-scala copied to clipboard
Chapter 9.8; Fig 9.12: Wrong order of method arguments for Image.star
In the PDF on page 105 in Chapter 9.8 the following code snipped is supposed to generate the stars shown in Fig. 9.12:
val star = Image
.star(100, 50, 5, 0.degrees)
[...]
however the order in which the arguments are given seems to be wrong when looking at the source code: https://github.com/creativescala/doodle/blob/79e41e13637592519cf809b0e2b34c5f4958b418/image/shared/src/main/scala/doodle/image/Image.scala#L203
I fixed it thus using the following order to create something like shown in the Fig. 9.12:
val star = Image
.star(5, 100, 50, 0.degrees)
[...]
Thanks for reporting. I'm going to experiment with a custom mdoc modifier (https://scalameta.org/mdoc/docs/modifiers.html#postmodifier) to render images, which should completely avoid this type of error in the future.