Skip to content

Commit

Permalink
Add example with rectangular canvas (for testing) (Sudha247#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 and FayCarsons committed Jan 26, 2024
1 parent 7f50b7b commit 731544f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions examples/rectangle_canvas.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ open Joy

let () =
init ~size:(500, 300) ();
background (255, 255, 255, 255);
let c = circle 50 in
set_color (0, 0, 0);
show [ c ];
write ~filename:"rectangle_canvas.png" ()
7 changes: 0 additions & 7 deletions lib/transform.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,9 @@ let rec translate dx dy = function
}
| Complex shapes -> Complex (List.map (translate dx dy) shapes)

<<<<<<< HEAD
let rec scale factor s =
let scale_length fact len = len *. fact in
let scale_point fact pt = pt *! fact in
match s with
=======
let scale_length fact len = len *. sqrt fact
let scale_point fact pt = pt *! sqrt fact
let rec scale factor = function
>>>>>>> dc851c7 (add proposal for color transforms)
| Circle circle' ->
Circle
{
Expand Down

0 comments on commit 731544f

Please sign in to comment.