@@ -13,42 +13,40 @@ import org.openrndr.shape.Triangle
13
13
* a 3x3 grid of triangles and lines.
14
14
*/
15
15
16
- fun main () {
17
- application {
18
- configure {
19
- width = 720
20
- height = 720
21
- }
16
+ fun main () = application {
17
+ configure {
18
+ width = 720
19
+ height = 720
20
+ }
22
21
23
- program {
24
- val font = loadFont(" demo-data/fonts/IBMPlexMono-Regular.ttf" , 20.0 )
25
- val pointA = Vector2 (0.0 , 50.0 )
26
- val pointB = Vector2 (50.0 , - 20.0 )
27
- val pointC = Vector2 (- 50.0 , 0.0 )
28
- val triangle = Triangle (pointA, pointB, pointC).contour
22
+ program {
23
+ val font = loadFont(" demo-data/fonts/IBMPlexMono-Regular.ttf" , 20.0 )
24
+ val pointA = Vector2 (0.0 , 50.0 )
25
+ val pointB = Vector2 (50.0 , - 20.0 )
26
+ val pointC = Vector2 (- 50.0 , 0.0 )
27
+ val triangle = Triangle (pointA, pointB, pointC).contour
29
28
30
- extend {
31
- drawer.apply {
32
- fill = ColorRGBa .GRAY
33
- stroke = ColorRGBa .PINK
34
- strokeWeight = 8.0
35
- fontMap = font
36
- LineCap .entries.forEachIndexed { x, cap ->
37
- lineCap = cap
38
- LineJoin .entries.forEachIndexed { y, join ->
39
- lineJoin = join
40
- val pos = IntVector2 (x - 1 , y - 1 ).vector2 * 180.0
41
- isolated {
42
- translate(bounds.position(0.46 , 0.46 ) + pos)
43
- text(" cap: ${cap.name} " , - 30.5 , 80.5 )
44
- text(" join: ${join.name} " , - 30.5 , 100.5 )
45
- contour(triangle)
46
- lineSegment(pointA - pointC, pointB - pointC)
47
- }
29
+ extend {
30
+ drawer.apply {
31
+ fill = ColorRGBa .GRAY
32
+ stroke = ColorRGBa .PINK
33
+ strokeWeight = 8.0
34
+ fontMap = font
35
+ LineCap .entries.forEachIndexed { x, cap ->
36
+ lineCap = cap
37
+ LineJoin .entries.forEachIndexed { y, join ->
38
+ lineJoin = join
39
+ val pos = IntVector2 (x - 1 , y - 1 ).vector2 * 180.0
40
+ isolated {
41
+ translate(bounds.position(0.46 , 0.46 ) + pos)
42
+ text(" cap: ${cap.name} " , - 30.5 , 80.5 )
43
+ text(" join: ${join.name} " , - 30.5 , 100.5 )
44
+ contour(triangle)
45
+ lineSegment(pointA - pointC, pointB - pointC)
48
46
}
49
47
}
50
48
}
51
49
}
52
50
}
53
51
}
54
- }
52
+ }
0 commit comments