blob: 560d0343070eac17dad0f59e72b5e870b4785003 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
translate 10 10
begin_block draw_lines
save
translate 50 50
save
setPen 0x7fff0000
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
restore
# and then draw the lines the other direction
save
setPen 0x7f0000ff
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
rotate 10
drawLine 50 0 10 0
restore
# and now with a clip
save
setClipRect -30 -30 60 60
setPen 0x7f00ff00
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
rotate 10
drawLine 10 0 50 0
restore
restore
end_block
save
translate 100 0
scale 2 2
repeat_block draw_lines
restore
translate 0 10
save
translate 0 200
setRenderHint Antialiasing
repeat_block draw_lines
restore
save
translate 100 200
scale 2 2
setRenderHint Antialiasing
repeat_block draw_lines
restore
translate 320 0
setPen black 0 solidline squarecap
begin_block lines
# 0 -> 45 degress
drawLine 100 100 200 90
drawLine 100 100 200 80
drawLine 100 100 200 70
drawLine 100 100 200 60
drawLine 100 100 200 50
drawLine 100 100 200 40
drawLine 100 100 200 30
drawLine 100 100 200 20
drawLine 100 100 200 10
# 45
drawLine 100 100 200 0
# 45 -> 90
drawLine 100 100 190 0
drawLine 100 100 180 0
drawLine 100 100 170 0
drawLine 100 100 160 0
drawLine 100 100 150 0
drawLine 100 100 140 0
drawLine 100 100 130 0
drawLine 100 100 120 0
drawLine 100 100 110 0
# 90
drawLine 100 100 100 0
# 90 -> 135
drawLine 100 100 90 0
drawLine 100 100 80 0
drawLine 100 100 70 0
drawLine 100 100 60 0
drawLine 100 100 50 0
drawLine 100 100 40 0
drawLine 100 100 30 0
drawLine 100 100 20 0
drawLine 100 100 10 0
# 135
drawLine 100 100 0 0
# 135 -> 180 degress
drawLine 100 100 0 10
drawLine 100 100 0 20
drawLine 100 100 0 30
drawLine 100 100 0 40
drawLine 100 100 0 50
drawLine 100 100 0 60
drawLine 100 100 0 70
drawLine 100 100 0 80
drawLine 100 100 0 90
# 180
drawLine 100 100 0 100
# 180 -> 225
drawLine 100 100 0 110
drawLine 100 100 0 120
drawLine 100 100 0 130
drawLine 100 100 0 140
drawLine 100 100 0 150
drawLine 100 100 0 160
drawLine 100 100 0 170
drawLine 100 100 0 180
drawLine 100 100 0 190
# 225
drawLine 100 100 0 200
# 225 -> 270
drawLine 100 100 10 200
drawLine 100 100 20 200
drawLine 100 100 30 200
drawLine 100 100 40 200
drawLine 100 100 50 200
drawLine 100 100 60 200
drawLine 100 100 70 200
drawLine 100 100 80 200
drawLine 100 100 90 200
# 270
drawLine 100 100 100 200
# 270 -> 315 degrees
drawLine 100 100 110 200
drawLine 100 100 120 200
drawLine 100 100 130 200
drawLine 100 100 140 200
drawLine 100 100 150 200
drawLine 100 100 160 200
drawLine 100 100 170 200
drawLine 100 100 180 200
drawLine 100 100 190 200
# 315
drawLine 100 100 200 200
# 315 -> 360 degress
drawLine 100 100 200 100
drawLine 100 100 200 110
drawLine 100 100 200 120
drawLine 100 100 200 130
drawLine 100 100 200 140
drawLine 100 100 200 150
drawLine 100 100 200 160
drawLine 100 100 200 170
drawLine 100 100 200 180
drawLine 100 100 200 190
end_block
setRenderHint Antialiasing
setPen 0x7fff0000
translate 0.5 0.5
repeat_block lines
setPen 0x000000 8
translate 20 240
drawText 0 0 "Steep slopes:"
translate 0 10
drawLine 0 0 -8 400
translate 20 0
drawLine 0 0 -7 400
translate 20 0
drawLine 0 0 -6 400
translate 20 0
drawLine 0 0 -5 400
translate 20 0
drawLine 0 0 -4 400
translate 20 0
drawLine 0 0 -3 400
translate 20 0
drawLine 0 0 -2 400
translate 20 0
drawLine 0 0 -1 400
translate 20 0
drawLine 0 0 0 400
translate 20 0
drawLine 0 0 1 400
translate 20 0
drawLine 0 0 2 400
translate 20 0
drawLine 0 0 3 400
translate 20 0
drawLine 0 0 4 400
translate 20 0
drawLine 0 0 5 400
translate 20 0
drawLine 0 0 6 400
translate 20 0
drawLine 0 0 7 400
translate 20 0
drawLine 0 0 8 400
resetMatrix
translate 20 450
drawText 0 0 "Zero length lines:"
translate 0 20
drawText 100 10 "Square cap"
save
begin_block points
setPen 0x000000 1 solidline squarecap
drawLine 0 0 0 0
setPen 0x000000 2 solidline squarecap
drawLine 8 0 8 0
setPen 0x000000 3 solidline squarecap
drawLine 16 0 16 0
setPen 0x000000 4 solidline squarecap
drawLine 24 0 24 0
setPen 0x000000 5 solidline squarecap
drawLine 32 0 32 0
setPen 0x000000 6 solidline squarecap
drawLine 40 0 40 0
setPen 0x000000 7 solidline squarecap
drawLine 48 0 48 0
setPen 0x000000 8 solidline squarecap
drawLine 57 0 57 0
setPen 0x000000 9 solidline squarecap
drawLine 67 0 67 0
setPen 0x000000 10 solidline squarecap
drawLine 78 0 78 0
end_block points
restore
translate 0 12
setRenderHint Antialiasing off
repeat_block points
setRenderHint Antialiasing
translate 0 20
drawText 100 10 "Round cap"
save
begin_block points2
setPen 0x000000 1 solidline roundcap
drawLine 0 0 0 0
setPen 0x000000 2 solidline roundcap
drawLine 8 0 8 0
setPen 0x000000 3 solidline roundcap
drawLine 16 0 16 0
setPen 0x000000 4 solidline roundcap
drawLine 24 0 24 0
setPen 0x000000 5 solidline roundcap
drawLine 32 0 32 0
setPen 0x000000 6 solidline roundcap
drawLine 40 0 40 0
setPen 0x000000 7 solidline roundcap
drawLine 48 0 48 0
setPen 0x000000 8 solidline roundcap
drawLine 57 0 57 0
setPen 0x000000 9 solidline roundcap
drawLine 67 0 67 0
setPen 0x000000 10 solidline roundcap
drawLine 78 0 78 0
end_block points2
restore
translate 0 12
setRenderHint Antialiasing off
repeat_block points2
setRenderHint Antialiasing
translate 0 20
drawText 100 10 "Flat cap"
save
begin_block points3
setPen 0x000000 1 solidline flatcap
drawLine 0 0 0 0
setPen 0x000000 2 solidline flatcap
drawLine 8 0 8 0
setPen 0x000000 3 solidline flatcap
drawLine 16 0 16 0
setPen 0x000000 4 solidline flatcap
drawLine 24 0 24 0
setPen 0x000000 5 solidline flatcap
drawLine 32 0 32 0
setPen 0x000000 6 solidline flatcap
drawLine 40 0 40 0
setPen 0x000000 7 solidline flatcap
drawLine 48 0 48 0
setPen 0x000000 8 solidline flatcap
drawLine 57 0 57 0
setPen 0x000000 9 solidline flatcap
drawLine 67 0 67 0
setPen 0x000000 10 solidline flatcap
drawLine 78 0 78 0
end_block points3
restore
translate 0 12
setRenderHint Antialiasing off
repeat_block points3
resetMatrix
translate -220 667.226
drawText 230 -80 "Task 194266 (should see only one line):"
setPen black
drawRect 230.5 -70.5 122 12
setRenderHint Antialiasing
setPen red
drawLine 236.842105263 -63.775117299 247.368421053 -63.775437504
setRenderHint Antialiasing off
resetMatrix
translate 10 640
setPen black
drawText 0 -10 "Task 207147 (should see two lines):"
drawRect 0.5 0.5 64 64
setRenderHint Antialiasing
setPen red
drawLine 4.5 4.5 4.5001 60.5
drawLine 4.5 4.5 60.5 4.5001
setRenderHint Antialiasing off
resetMatrix
translate 10 730
setPen black
drawText 0 -10 "Task 229459 (should see one diagonal line):"
drawRect 0.5 0.5 64 64
setPen red 2 solidline flatcap
setClipRect 2 2 63 63
drawLine 1.5 1.5 33560000 33560000
|