Skip to content

Commit

Permalink
Add example with rectangular canvas (for testing) (#87)
Browse files Browse the repository at this point in the history
A circle in a rectangular canvas should not become an ellipse.
  • Loading branch information
nikochiko authored Jan 16, 2024
1 parent 7d46fd7 commit 6a9209d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/dune
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,17 @@
(modules rectangle)
(libraries joy))

(executable
(name rectangle_canvas)
(modules rectangle_canvas)
(libraries joy))

(executable
(name star)
(modules star)
(libraries joy))
(executable

(executable
(name repeat)
(modules repeat)
(libraries joy))
9 changes: 9 additions & 0 deletions examples/rectangle_canvas.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
open Joy

let () =
init ~size:(500., 300.) ();
background (1., 1., 1., 1.);
let c = circle 50. in
set_color (0., 0., 0.);
show [ c ];
write ~filename:"rectangular_canvas.png" ()

0 comments on commit 6a9209d

Please sign in to comment.