processing 1.0.3 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e927a6321823d27c02241290fbcfc158722c62b97fc2539c8d7b998ba5ac3f8
4
- data.tar.gz: c44eb3121498ef59d54b04aa89cd4f85f85636b57e670ab28cbd5a96d85cb59d
3
+ metadata.gz: 0fa962b9be37f4c531181592daf0b6082e19f8ab6c5bfd7dc62c0e4345db7bf0
4
+ data.tar.gz: af9cd09645d3441d49fa0d4811860d0c56c2f56bc7b572c54d9bf6f1e554839c
5
5
  SHA512:
6
- metadata.gz: 613322d3e0f202d2d1e32b686fb55ffcff83b26a7eca92490b0ba3123f0821bf4e5b946b4719d94ed1d203180eeba9d656e21efa618c2c7c22fe3b247a53baf9
7
- data.tar.gz: b07a6c06178cb061aa7239263605ee5a76232ab1148ec957dad6f136603b5329fc63983d9774a2d663875ae1821c32e6477e4f07585d90ad123ec3bd7b2b93f2
6
+ metadata.gz: 933c76dfa4097a9953ead96442ab0340201ab1d3ddb5afb29513a8a4cac33da2158f81b3df054f6af0d8ee20a5e2b98349d5756f74e4b9dd2bc4db235c4654fb
7
+ data.tar.gz: 43d1309d718144c65d2720b5a863c13e8184ef492be6f5612b995988821a5e157cbd3e37930c8c5307770257add373951c4d8d57ec3bfe987851e1f6f9abce28
@@ -24,7 +24,7 @@ jobs:
24
24
  run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
25
25
 
26
26
  - name: test
27
- run: bundle exec rake quiet test
27
+ run: bundle exec rake quiet packages test
28
28
 
29
29
  - name: create gem
30
30
  id: gem
@@ -24,6 +24,9 @@ jobs:
24
24
  - name: setup dependencies
25
25
  run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
26
26
 
27
+ - name: packages
28
+ run: bundle exec rake packages
29
+
27
30
  - name: lib
28
31
  run: bundle exec rake lib
29
32
 
data/ChangeLog.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # processing ChangeLog
2
2
 
3
3
 
4
+ ## [v1.1.1] - 2025-01-13
5
+
6
+ - Update URLs as p5js.org has been relaunched
7
+ - Update LICENSE
8
+
9
+ - 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
10
+
11
+
12
+ ## [v1.1] - 2024-07-06
13
+
14
+ - Support Windows
15
+
16
+
4
17
  ## [v1.0.3] - 2024-07-05
5
18
 
6
19
  - Update workflows for test
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.3.1)
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-22
27
+ arm64-darwin-23
30
28
 
31
29
  DEPENDENCIES
32
30
  ferrum
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 xord.org
3
+ Copyright (c) 2019 xord.org
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  # -*- mode: ruby -*-
2
2
 
3
-
4
3
  %w[../xot ../rucy ../rays ../reflex .]
5
4
  .map {|s| File.expand_path "#{s}/lib", __dir__}
6
5
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
@@ -26,7 +25,7 @@ ENV['RDOC'] = 'yardoc --no-private'
26
25
 
27
26
  default_tasks
28
27
  use_bundler
29
- test_ruby_extension
28
+ test_ruby_extension unless github_actions? && win32?
30
29
  generate_documents
31
30
  build_ruby_gem
32
31
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.1.1
@@ -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/#/p5/setup
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/#/p5/draw
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/#/p5/keyPressed
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/#/p5/keyReleased
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/#/p5/keyTyped
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/#/p5/mousePressed
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/#/p5/mouseReleased
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/#/p5/mouseMoved
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/#/p5/mouseDragged
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/#/p5/mouseClicked
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/#/p5/doubleClicked
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/#/p5/mouseWheel
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/#/p5/touchStarted
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/#/p5/touchEnded
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/#/p5/touchMoved
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/#/p5/windowResized
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/#/p5/createCanvas
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/#/p5/pixelDensity
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/#/p5/fullscreen
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/#/p5/smooth
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/#/p5/noSmooth
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/#/p5/displayWidth
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/#/p5/displayHeight
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/#/p5/displayDensity
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/#/p5/windowWidth
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/#/p5/windowHeight
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/#/p5/focused
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/#/p5/frameCount
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/#/p5/frameRate
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/#/p5/deltaTime
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/#/p5/key
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/#/p5/keyCode
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/#/p5/keyIsPressed
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/#/p5/keyIsDown
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/#/p5/mouseX
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/#/p5/mouseY
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/#/p5/pmouseX
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/#/p5/pmouseY
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/#/p5/mouseButton
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/#/p5/touches
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/#/p5/loop
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/#/p5/noLoop
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/#/p5/redraw
823
+ # @see https://p5js.org/reference/p5/redraw/
824
824
  #
825
825
  def redraw()
826
826
  @redraw__ = true
@@ -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/#/p5.Font
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/#/p5.Font/textBounds
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
@@ -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/#/p5.Graphics
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/#/p5.Graphics
16
+ # @see https://p5js.org/reference/p5/p5.Graphics/
17
17
  #
18
18
  def initialize(width, height, pixelDensity = 1)
19
- image = Rays::Image.new width, height, Rays::RGBA, pixelDensity
19
+ image = Rays::Image.new(
20
+ width, height, Rays::RGBA, pixel_density: pixelDensity)
20
21
  init__ image, image.painter
21
22
  end
22
23