Skip to content

Commit

Permalink
Resolve conflicts after merging with master
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Dec 13, 2023
1 parent 12512ca commit 5c07272
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/higher_transforms.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let rec range a b = if a > b then [] else a :: range (a + 1) b

let () =
init ();
let initial = rectangle ~x:(-250) ~y:(-250) 100 100 in
let initial = rectangle ~point:{ x = -250; y = -250 } 100 100 in
let match_list l =
match l with
| [] -> [ transform initial ]
Expand Down
12 changes: 6 additions & 6 deletions lib/shape.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ let render_polygon polygon' =
let points =
Array.of_list
(List.map
(fun point ->
let { x; y } = denormalize point in
(x, y))
polygon')
(fun point ->
let { x; y } = denormalize point in
(x, y))
polygon')
in
draw_poly points

Expand All @@ -61,8 +61,8 @@ let circle ?x ?y r =
| Some x, Some y -> Circle { c = { x; y }; radius = r }
| _ -> Circle { c = { x = 0; y = 0 }; radius = r }

let rectangle ?x ?y length width =
let x, y = match (x, y) with Some x, Some y -> (x, y) | _ -> (0, 0) in
let rectangle ?point length width =
let x, y = match point with Some { x; y } -> (x, y) | None -> (0, 0) in
Polygon
[
{ x; y };
Expand Down
2 changes: 1 addition & 1 deletion lib/shape.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type point = { x : int; y : int }

val render_shape : shape -> unit
val circle : ?x:int -> ?y:int -> int -> shape
val rectangle : ?x:int -> ?y:int -> int -> int -> shape
val rectangle : ?point:point -> int -> int -> shape
val ellipse : ?x:int -> ?y:int -> int -> int -> shape
val complex : shape list -> shape
val line : ?x1:int -> ?y1:int -> int -> int -> shape
Expand Down

0 comments on commit 5c07272

Please sign in to comment.