-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Int API * Int API * applied some reviews * applying review suggestions * doc for set_line_width --------- Co-authored-by: Kaustubh Maske Patil <[email protected]>
- Loading branch information
1 parent
7f4ab94
commit 8fffcb5
Showing
32 changed files
with
206 additions
and
216 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
open Joy | ||
|
||
let size = 800. | ||
let interval = 16. | ||
let line_interval = 800. /. interval | ||
let rec range a b = if a > b then [] else a :: range (a +. 1.) b | ||
let inc x = x +. 1. | ||
let size = 800 | ||
let interval = 16 | ||
let line_interval = 800 / interval | ||
let rec range a b = if a > b then [] else a :: range (a + 1) b | ||
let inc x = x + 1 | ||
|
||
let _ = | ||
init ~size:(size, size) (); | ||
let half_size = size /. 2. in | ||
background (1., 1., 1., 1.); | ||
let half_size = size / 2 in | ||
background (255, 255, 255, 255); | ||
let lines = | ||
List.map | ||
(fun i -> | ||
let newx = i |> inc |> ( *. ) line_interval in | ||
let newx = i |> inc |> ( * ) line_interval in | ||
line | ||
~a:(point (newx -. half_size) (-.half_size)) | ||
(point (newx -. half_size) half_size)) | ||
(range 0. interval) | ||
~a:(point (newx - half_size) (-half_size)) | ||
(point (newx - half_size) half_size)) | ||
(range 0 interval) | ||
in | ||
set_color (0., 0., 0.); | ||
set_color (0, 0, 0); | ||
show lines; | ||
write ~filename:"line.png" () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
open Joy | ||
|
||
let size = 100. | ||
let size = 100 | ||
|
||
let () = | ||
init (); | ||
background (1., 1., 1., 1.); | ||
background (255, 255, 255, 255); | ||
(* creating a rectangle from points *) | ||
let rect = rectangle size size in | ||
set_color (0., 0., 0.); | ||
set_color (0, 0, 0); | ||
render rect; | ||
write ~filename:"rectangle.png" () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.