processing 1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/utils.rb +1 -1
- data/ChangeLog.md +14 -0
- data/Gemfile.lock +2 -4
- data/LICENSE +1 -1
- data/Rakefile +0 -1
- data/VERSION +1 -1
- data/lib/processing/context.rb +43 -43
- data/lib/processing/font.rb +2 -2
- data/lib/processing/graphics.rb +4 -3
- data/lib/processing/graphics_context.rb +125 -125
- data/lib/processing/image.rb +13 -13
- data/lib/processing/shader.rb +2 -2
- data/lib/processing/shape.rb +6 -6
- data/lib/processing/svg.rb +2 -2
- data/lib/processing/vector.rb +42 -42
- data/lib/processing/window.rb +15 -8
- data/lib/processing.rb +10 -8
- data/processing.gemspec +5 -5
- metadata +34 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 159f0c770707e1d98c9d4ac42ad3f64fb33b8015b36c888bc324cfda5502ca6b
|
4
|
+
data.tar.gz: aaa6a13dadcd68f6019c6aecaf170f52a77e7c0415dcfd54c75e9b991cd3f766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c504755164e52205c77a200f058429507ad4d64251f30b9f9d25318507fd33e134798225c28b9690dd1b4db10a9f82ab3d3d070750f8f328cd2c9a819ee52da
|
7
|
+
data.tar.gz: a96bc6008c03e6e69ab980f8cee631867f92328950256d33e180b3fb2f490bb3ad5b80d853d675b3b497c940c75b7f51d903a982caf920705073058aa9a81a8b
|
data/.github/workflows/utils.rb
CHANGED
@@ -20,7 +20,7 @@ def setup_dependencies(build: true, only: nil)
|
|
20
20
|
|
21
21
|
exts.each do |ext|
|
22
22
|
gem = RENAMES[ext.to_sym].then {|s| s || ext}
|
23
|
-
ver = gemspec[/
|
23
|
+
ver = gemspec[/add_dependency.*['"]#{gem}['"].*['"]\s*>=\s*([\d\.]+)\s*['"]/, 1]
|
24
24
|
opts = '-c advice.detachedHead=false --depth 1'
|
25
25
|
clone = "git clone #{opts} https://github.com/xord/#{ext}.git ../#{ext}"
|
26
26
|
|
data/ChangeLog.md
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
# processing ChangeLog
|
2
2
|
|
3
3
|
|
4
|
+
## [v1.1.2] - 2025-01-14
|
5
|
+
|
6
|
+
- Update workflow files
|
7
|
+
- Set minumum version for runtime dependency
|
8
|
+
|
9
|
+
|
10
|
+
## [v1.1.1] - 2025-01-13
|
11
|
+
|
12
|
+
- Update URLs as p5js.org has been relaunched
|
13
|
+
- Update LICENSE
|
14
|
+
|
15
|
+
- Fix a bug in which the display magnification was fixed at 1x when the size specified by size() was different from the window size and the aspect ratio of both windows was the same
|
16
|
+
|
17
|
+
|
4
18
|
## [v1.1] - 2024-07-06
|
5
19
|
|
6
20
|
- Support Windows
|
data/Gemfile.lock
CHANGED
@@ -12,9 +12,7 @@ GEM
|
|
12
12
|
power_assert (2.0.3)
|
13
13
|
public_suffix (5.0.3)
|
14
14
|
rake (13.1.0)
|
15
|
-
rexml (3.
|
16
|
-
strscan
|
17
|
-
strscan (3.1.0)
|
15
|
+
rexml (3.4.0)
|
18
16
|
test-unit (3.6.1)
|
19
17
|
power_assert
|
20
18
|
webrick (1.7.0)
|
@@ -26,7 +24,7 @@ GEM
|
|
26
24
|
PLATFORMS
|
27
25
|
arm64-darwin-20
|
28
26
|
arm64-darwin-21
|
29
|
-
arm64-darwin-
|
27
|
+
arm64-darwin-23
|
30
28
|
|
31
29
|
DEPENDENCIES
|
32
30
|
ferrum
|
data/LICENSE
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1
|
1
|
+
1.1.2
|
data/lib/processing/context.rb
CHANGED
@@ -181,7 +181,7 @@ module Processing
|
|
181
181
|
# @return [nil] nil
|
182
182
|
#
|
183
183
|
# @see https://processing.org/reference/setup_.html
|
184
|
-
# @see https://p5js.org/reference
|
184
|
+
# @see https://p5js.org/reference/p5/setup/
|
185
185
|
#
|
186
186
|
def setup(&block)
|
187
187
|
@window__.setup = block if block
|
@@ -214,7 +214,7 @@ module Processing
|
|
214
214
|
# @return [nil] nil
|
215
215
|
#
|
216
216
|
# @see https://processing.org/reference/draw_.html
|
217
|
-
# @see https://p5js.org/reference
|
217
|
+
# @see https://p5js.org/reference/p5/draw/
|
218
218
|
#
|
219
219
|
def draw(&block)
|
220
220
|
@drawBlock__ = block if block
|
@@ -226,7 +226,7 @@ module Processing
|
|
226
226
|
# @return [Boolean] is any key pressed or not
|
227
227
|
#
|
228
228
|
# @see https://processing.org/reference/keyPressed_.html
|
229
|
-
# @see https://p5js.org/reference
|
229
|
+
# @see https://p5js.org/reference/p5/keyPressed/
|
230
230
|
#
|
231
231
|
def keyPressed(&block)
|
232
232
|
@keyPressedBlock__ = block if block
|
@@ -238,7 +238,7 @@ module Processing
|
|
238
238
|
# @return [nil] nil
|
239
239
|
#
|
240
240
|
# @see https://processing.org/reference/keyReleased_.html
|
241
|
-
# @see https://p5js.org/reference
|
241
|
+
# @see https://p5js.org/reference/p5/keyReleased/
|
242
242
|
#
|
243
243
|
def keyReleased(&block)
|
244
244
|
@keyReleasedBlock__ = block if block
|
@@ -250,7 +250,7 @@ module Processing
|
|
250
250
|
# @return [nil] nil
|
251
251
|
#
|
252
252
|
# @see https://processing.org/reference/keyTyped_.html
|
253
|
-
# @see https://p5js.org/reference
|
253
|
+
# @see https://p5js.org/reference/p5/keyTyped/
|
254
254
|
#
|
255
255
|
def keyTyped(&block)
|
256
256
|
@keyTypedBlock__ = block if block
|
@@ -263,7 +263,7 @@ module Processing
|
|
263
263
|
#
|
264
264
|
# @see https://processing.org/reference/mousePressed_.html
|
265
265
|
# @see https://processing.org/reference/mousePressed.html
|
266
|
-
# @see https://p5js.org/reference
|
266
|
+
# @see https://p5js.org/reference/p5/mousePressed/
|
267
267
|
#
|
268
268
|
def mousePressed(&block)
|
269
269
|
@mousePressedBlock__ = block if block
|
@@ -275,7 +275,7 @@ module Processing
|
|
275
275
|
# @return [nil] nil
|
276
276
|
#
|
277
277
|
# @see https://processing.org/reference/mouseReleased_.html
|
278
|
-
# @see https://p5js.org/reference
|
278
|
+
# @see https://p5js.org/reference/p5/mouseReleased/
|
279
279
|
#
|
280
280
|
def mouseReleased(&block)
|
281
281
|
@mouseReleasedBlock__ = block if block
|
@@ -287,7 +287,7 @@ module Processing
|
|
287
287
|
# @return [nil] nil
|
288
288
|
#
|
289
289
|
# @see https://processing.org/reference/mouseMoved_.html
|
290
|
-
# @see https://p5js.org/reference
|
290
|
+
# @see https://p5js.org/reference/p5/mouseMoved/
|
291
291
|
#
|
292
292
|
def mouseMoved(&block)
|
293
293
|
@mouseMovedBlock__ = block if block
|
@@ -299,7 +299,7 @@ module Processing
|
|
299
299
|
# @return [nil] nil
|
300
300
|
#
|
301
301
|
# @see https://processing.org/reference/mouseDragged_.html
|
302
|
-
# @see https://p5js.org/reference
|
302
|
+
# @see https://p5js.org/reference/p5/mouseDragged/
|
303
303
|
#
|
304
304
|
def mouseDragged(&block)
|
305
305
|
@mouseDraggedBlock__ = block if block
|
@@ -311,7 +311,7 @@ module Processing
|
|
311
311
|
# @return [nil] nil
|
312
312
|
#
|
313
313
|
# @see https://processing.org/reference/mouseClicked_.html
|
314
|
-
# @see https://p5js.org/reference
|
314
|
+
# @see https://p5js.org/reference/p5/mouseClicked/
|
315
315
|
#
|
316
316
|
def mouseClicked(&block)
|
317
317
|
@mouseClickedBlock__ = block if block
|
@@ -322,7 +322,7 @@ module Processing
|
|
322
322
|
#
|
323
323
|
# @return [nil] nil
|
324
324
|
#
|
325
|
-
# @see https://p5js.org/reference
|
325
|
+
# @see https://p5js.org/reference/p5/doubleClicked/
|
326
326
|
#
|
327
327
|
def doubleClicked(&block)
|
328
328
|
@doubleClickedBlock__ = block if block
|
@@ -334,7 +334,7 @@ module Processing
|
|
334
334
|
# @return [nil] nil
|
335
335
|
#
|
336
336
|
# @see https://processing.org/reference/mouseWheel_.html
|
337
|
-
# @see https://p5js.org/reference
|
337
|
+
# @see https://p5js.org/reference/p5/mouseWheel/
|
338
338
|
#
|
339
339
|
def mouseWheel(&block)
|
340
340
|
@mouseWheelBlock__ = block if block
|
@@ -345,7 +345,7 @@ module Processing
|
|
345
345
|
#
|
346
346
|
# @return [nil] nil
|
347
347
|
#
|
348
|
-
# @see https://p5js.org/reference
|
348
|
+
# @see https://p5js.org/reference/p5/touchStarted/
|
349
349
|
#
|
350
350
|
def touchStarted(&block)
|
351
351
|
@touchStartedBlock__ = block if block
|
@@ -356,7 +356,7 @@ module Processing
|
|
356
356
|
#
|
357
357
|
# @return [nil] nil
|
358
358
|
#
|
359
|
-
# @see https://p5js.org/reference
|
359
|
+
# @see https://p5js.org/reference/p5/touchEnded/
|
360
360
|
#
|
361
361
|
def touchEnded(&block)
|
362
362
|
@touchEndedBlock__ = block if block
|
@@ -367,7 +367,7 @@ module Processing
|
|
367
367
|
#
|
368
368
|
# @return [nil] nil
|
369
369
|
#
|
370
|
-
# @see https://p5js.org/reference
|
370
|
+
# @see https://p5js.org/reference/p5/touchMoved/
|
371
371
|
#
|
372
372
|
def touchMoved(&block)
|
373
373
|
@touchMovedBlock__ = block if block
|
@@ -390,7 +390,7 @@ module Processing
|
|
390
390
|
# @return [nil] nil
|
391
391
|
#
|
392
392
|
# @see https://processing.org/reference/windowResized_.html
|
393
|
-
# @see https://p5js.org/reference
|
393
|
+
# @see https://p5js.org/reference/p5/windowResized/
|
394
394
|
#
|
395
395
|
def windowResized(&block)
|
396
396
|
@windowResizedBlock__ = block if block
|
@@ -430,7 +430,7 @@ module Processing
|
|
430
430
|
#
|
431
431
|
# @return [nil] nil
|
432
432
|
#
|
433
|
-
# @see https://p5js.org/reference
|
433
|
+
# @see https://p5js.org/reference/p5/createCanvas/
|
434
434
|
#
|
435
435
|
def createCanvas(width, height, pixelDensity: self.pixelDensity)
|
436
436
|
windowResize width, height
|
@@ -458,7 +458,7 @@ module Processing
|
|
458
458
|
# @return [Numeric] current pixel density
|
459
459
|
#
|
460
460
|
# @see https://processing.org/reference/pixelDensity_.html
|
461
|
-
# @see https://p5js.org/reference
|
461
|
+
# @see https://p5js.org/reference/p5/pixelDensity/
|
462
462
|
#
|
463
463
|
def pixelDensity(density = nil)
|
464
464
|
resizeCanvas__ width, height, density if density
|
@@ -472,7 +472,7 @@ module Processing
|
|
472
472
|
# @return [Boolean] current state
|
473
473
|
#
|
474
474
|
# @see https://processing.org/reference/fullScreen_.html
|
475
|
-
# @see https://p5js.org/reference
|
475
|
+
# @see https://p5js.org/reference/p5/fullscreen/
|
476
476
|
#
|
477
477
|
def fullscreen(state = nil)
|
478
478
|
@window__.fullscreen = state if state != nil
|
@@ -487,7 +487,7 @@ module Processing
|
|
487
487
|
# @return [nil] nil
|
488
488
|
#
|
489
489
|
# @see https://processing.org/reference/smooth_.html
|
490
|
-
# @see https://p5js.org/reference
|
490
|
+
# @see https://p5js.org/reference/p5/smooth/
|
491
491
|
#
|
492
492
|
def smooth()
|
493
493
|
@smooth__ = true
|
@@ -500,7 +500,7 @@ module Processing
|
|
500
500
|
# @return [nil] nil
|
501
501
|
#
|
502
502
|
# @see https://processing.org/reference/noSmooth_.html
|
503
|
-
# @see https://p5js.org/reference
|
503
|
+
# @see https://p5js.org/reference/p5/noSmooth/
|
504
504
|
#
|
505
505
|
def noSmooth()
|
506
506
|
@smooth__ = false
|
@@ -518,7 +518,7 @@ module Processing
|
|
518
518
|
# @return [Numeric] width
|
519
519
|
#
|
520
520
|
# @see https://processing.org/reference/displayWidth.html
|
521
|
-
# @see https://p5js.org/reference
|
521
|
+
# @see https://p5js.org/reference/p5/displayWidth/
|
522
522
|
#
|
523
523
|
def displayWidth()
|
524
524
|
@window__.screen.width
|
@@ -529,7 +529,7 @@ module Processing
|
|
529
529
|
# @return [Numeric] height
|
530
530
|
#
|
531
531
|
# @see https://processing.org/reference/displayHeight.html
|
532
|
-
# @see https://p5js.org/reference
|
532
|
+
# @see https://p5js.org/reference/p5/displayHeight/
|
533
533
|
#
|
534
534
|
def displayHeight()
|
535
535
|
@window__.screen.height
|
@@ -540,7 +540,7 @@ module Processing
|
|
540
540
|
# @return [Numeric] pixel density
|
541
541
|
#
|
542
542
|
# @see https://processing.org/reference/displayDensity_.html
|
543
|
-
# @see https://p5js.org/reference
|
543
|
+
# @see https://p5js.org/reference/p5/displayDensity/
|
544
544
|
#
|
545
545
|
def displayDensity()
|
546
546
|
@window__.painter.pixel_density
|
@@ -617,7 +617,7 @@ module Processing
|
|
617
617
|
#
|
618
618
|
# @return [Numeric] window width
|
619
619
|
#
|
620
|
-
# @see https://p5js.org/reference
|
620
|
+
# @see https://p5js.org/reference/p5/windowWidth/
|
621
621
|
#
|
622
622
|
def windowWidth()
|
623
623
|
@window__.width
|
@@ -627,7 +627,7 @@ module Processing
|
|
627
627
|
#
|
628
628
|
# @return [Numeric] window height
|
629
629
|
#
|
630
|
-
# @see https://p5js.org/reference
|
630
|
+
# @see https://p5js.org/reference/p5/windowHeight/
|
631
631
|
#
|
632
632
|
def windowHeight()
|
633
633
|
@window__.height
|
@@ -638,7 +638,7 @@ module Processing
|
|
638
638
|
# @return [Boolean] active or not
|
639
639
|
#
|
640
640
|
# @see https://processing.org/reference/focused.html
|
641
|
-
# @see https://p5js.org/reference
|
641
|
+
# @see https://p5js.org/reference/p5/focused/
|
642
642
|
#
|
643
643
|
def focused()
|
644
644
|
@window__.active?
|
@@ -649,7 +649,7 @@ module Processing
|
|
649
649
|
# @return [Integer] total number of frames
|
650
650
|
#
|
651
651
|
# @see https://processing.org/reference/frameCount.html
|
652
|
-
# @see https://p5js.org/reference
|
652
|
+
# @see https://p5js.org/reference/p5/frameCount/
|
653
653
|
#
|
654
654
|
def frameCount()
|
655
655
|
@frameCount__
|
@@ -660,7 +660,7 @@ module Processing
|
|
660
660
|
# @return [Float] frames per second
|
661
661
|
#
|
662
662
|
# @see https://processing.org/reference/frameRate.html
|
663
|
-
# @see https://p5js.org/reference
|
663
|
+
# @see https://p5js.org/reference/p5/frameRate/
|
664
664
|
#
|
665
665
|
def frameRate()
|
666
666
|
@window__.event.fps
|
@@ -670,7 +670,7 @@ module Processing
|
|
670
670
|
#
|
671
671
|
# @return [Float] elapsed time in milliseconds
|
672
672
|
#
|
673
|
-
# @see https://p5js.org/reference
|
673
|
+
# @see https://p5js.org/reference/p5/deltaTime/
|
674
674
|
#
|
675
675
|
def deltaTime()
|
676
676
|
@window__.event.dt * 1000
|
@@ -681,7 +681,7 @@ module Processing
|
|
681
681
|
# @return [String] last key
|
682
682
|
#
|
683
683
|
# @see https://processing.org/reference/key.html
|
684
|
-
# @see https://p5js.org/reference
|
684
|
+
# @see https://p5js.org/reference/p5/key/
|
685
685
|
#
|
686
686
|
def key()
|
687
687
|
@key__
|
@@ -692,7 +692,7 @@ module Processing
|
|
692
692
|
# @return [Symbol] last key code
|
693
693
|
#
|
694
694
|
# @see https://processing.org/reference/keyCode.html
|
695
|
-
# @see https://p5js.org/reference
|
695
|
+
# @see https://p5js.org/reference/p5/keyCode/
|
696
696
|
#
|
697
697
|
def keyCode()
|
698
698
|
@keyCode__
|
@@ -702,7 +702,7 @@ module Processing
|
|
702
702
|
#
|
703
703
|
# @return [Boolean] is any key pressed or not
|
704
704
|
#
|
705
|
-
# @see https://p5js.org/reference
|
705
|
+
# @see https://p5js.org/reference/p5/keyIsPressed/
|
706
706
|
#
|
707
707
|
def keyIsPressed()
|
708
708
|
not @keysPressed__.empty?
|
@@ -714,7 +714,7 @@ module Processing
|
|
714
714
|
#
|
715
715
|
# @return [Boolean] is the key pressed or not
|
716
716
|
#
|
717
|
-
# @see https://p5js.org/reference
|
717
|
+
# @see https://p5js.org/reference/p5/keyIsDown/
|
718
718
|
#
|
719
719
|
def keyIsDown(keyCode)
|
720
720
|
@keysPressed__.include? keyCode
|
@@ -725,7 +725,7 @@ module Processing
|
|
725
725
|
# @return [Numeric] horizontal position of mouse
|
726
726
|
#
|
727
727
|
# @see https://processing.org/reference/mouseX.html
|
728
|
-
# @see https://p5js.org/reference
|
728
|
+
# @see https://p5js.org/reference/p5/mouseX/
|
729
729
|
#
|
730
730
|
def mouseX()
|
731
731
|
@pointer__&.x || 0
|
@@ -736,7 +736,7 @@ module Processing
|
|
736
736
|
# @return [Numeric] vertical position of mouse
|
737
737
|
#
|
738
738
|
# @see https://processing.org/reference/mouseY.html
|
739
|
-
# @see https://p5js.org/reference
|
739
|
+
# @see https://p5js.org/reference/p5/mouseY/
|
740
740
|
#
|
741
741
|
def mouseY()
|
742
742
|
@pointer__&.y || 0
|
@@ -747,7 +747,7 @@ module Processing
|
|
747
747
|
# @return [Numeric] horizontal position of mouse
|
748
748
|
#
|
749
749
|
# @see https://processing.org/reference/pmouseX.html
|
750
|
-
# @see https://p5js.org/reference
|
750
|
+
# @see https://p5js.org/reference/p5/pmouseX/
|
751
751
|
#
|
752
752
|
def pmouseX()
|
753
753
|
@pointerPrev__&.x || 0
|
@@ -758,7 +758,7 @@ module Processing
|
|
758
758
|
# @return [Numeric] vertical position of mouse
|
759
759
|
#
|
760
760
|
# @see https://processing.org/reference/pmouseY.html
|
761
|
-
# @see https://p5js.org/reference
|
761
|
+
# @see https://p5js.org/reference/p5/pmouseY/
|
762
762
|
#
|
763
763
|
def pmouseY()
|
764
764
|
@pointerPrev__&.y || 0
|
@@ -769,7 +769,7 @@ module Processing
|
|
769
769
|
# @return [Numeric] LEFT, RIGHT, CENTER or 0
|
770
770
|
#
|
771
771
|
# @see https://processing.org/reference/mouseButton.html
|
772
|
-
# @see https://p5js.org/reference
|
772
|
+
# @see https://p5js.org/reference/p5/mouseButton/
|
773
773
|
#
|
774
774
|
def mouseButton()
|
775
775
|
((@pointersPressed__ + @pointersReleased__) & [LEFT, RIGHT, CENTER]).last
|
@@ -779,7 +779,7 @@ module Processing
|
|
779
779
|
#
|
780
780
|
# @return [Array] Touch objects
|
781
781
|
#
|
782
|
-
# @see https://p5js.org/reference
|
782
|
+
# @see https://p5js.org/reference/p5/touches/
|
783
783
|
#
|
784
784
|
def touches()
|
785
785
|
@touches__
|
@@ -798,7 +798,7 @@ module Processing
|
|
798
798
|
# @return [nil] nil
|
799
799
|
#
|
800
800
|
# @see https://processing.org/reference/loop_.html
|
801
|
-
# @see https://p5js.org/reference
|
801
|
+
# @see https://p5js.org/reference/p5/loop/
|
802
802
|
#
|
803
803
|
def loop()
|
804
804
|
@loop__ = true
|
@@ -809,7 +809,7 @@ module Processing
|
|
809
809
|
# @return [nil] nil
|
810
810
|
#
|
811
811
|
# @see https://processing.org/reference/noLoop_.html
|
812
|
-
# @see https://p5js.org/reference
|
812
|
+
# @see https://p5js.org/reference/p5/noLoop/
|
813
813
|
#
|
814
814
|
def noLoop()
|
815
815
|
@loop__ = false
|
@@ -820,7 +820,7 @@ module Processing
|
|
820
820
|
# @return [nil] nil
|
821
821
|
#
|
822
822
|
# @see https://processing.org/reference/redraw_.html
|
823
|
-
# @see https://p5js.org/reference
|
823
|
+
# @see https://p5js.org/reference/p5/redraw/
|
824
824
|
#
|
825
825
|
def redraw()
|
826
826
|
@redraw__ = true
|
data/lib/processing/font.rb
CHANGED
@@ -4,7 +4,7 @@ module Processing
|
|
4
4
|
# Font object.
|
5
5
|
#
|
6
6
|
# @see https://processing.org/reference/PFont.html
|
7
|
-
# @see https://p5js.org/reference
|
7
|
+
# @see https://p5js.org/reference/p5/p5.Font/
|
8
8
|
#
|
9
9
|
class Font
|
10
10
|
|
@@ -27,7 +27,7 @@ module Processing
|
|
27
27
|
#
|
28
28
|
# @return [TextBounds] bounding box for text
|
29
29
|
#
|
30
|
-
# @see https://p5js.org/reference
|
30
|
+
# @see https://p5js.org/reference/p5.Font/textBounds/
|
31
31
|
#
|
32
32
|
def textBounds(str, x = 0, y = 0, fontSize = nil)
|
33
33
|
font = getInternal__ fontSize
|
data/lib/processing/graphics.rb
CHANGED
@@ -4,7 +4,7 @@ module Processing
|
|
4
4
|
# Draws graphics into an offscreen buffer
|
5
5
|
#
|
6
6
|
# @see https://processing.org/reference/PGraphics.html
|
7
|
-
# @see https://p5js.org/reference
|
7
|
+
# @see https://p5js.org/reference/p5/p5.Graphics/
|
8
8
|
#
|
9
9
|
class Graphics
|
10
10
|
|
@@ -13,10 +13,11 @@ module Processing
|
|
13
13
|
|
14
14
|
# Initialize graphics object.
|
15
15
|
#
|
16
|
-
# @see https://p5js.org/reference
|
16
|
+
# @see https://p5js.org/reference/p5/p5.Graphics/
|
17
17
|
#
|
18
18
|
def initialize(width, height, pixelDensity = 1)
|
19
|
-
image = Rays::Image.new
|
19
|
+
image = Rays::Image.new(
|
20
|
+
width, height, Rays::RGBA, pixel_density: pixelDensity)
|
20
21
|
init__ image, image.painter
|
21
22
|
end
|
22
23
|
|