processing 0.5.24 → 0.5.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80111264884369244c4162ec69d6158c1f0bb69d04d8f33517370f568ec81779
4
- data.tar.gz: 4004e0f90e2839ea7b467005a5d8f0c94921b719cd597f6e7145894fe1b300fe
3
+ metadata.gz: b23f276afb978da023d28bafdb1d4fecdebe056cb9c0e99b34eeb4439cb3267c
4
+ data.tar.gz: 9f5416685952e8ad4d0cd0282ddffcd0e7c379baba882ab0a5b75f5d56b560f6
5
5
  SHA512:
6
- metadata.gz: 3cfa7f41a0dc0f216751f1b5e1c3faf04d7334f6c2e87329a34ac057234e31e5f3e34354118edff1cde0fecd6be1ca5874079ab3110b50894c0cfab037ef0318
7
- data.tar.gz: aa38853b9e8817a835ba21446485c8b2d3301f14d60ff067a2e121a2fc1631ed691a1610848dde9bd3cf4294af2a342bf8f78bc3fac42ce20392eafc9164d78f
6
+ metadata.gz: 3e5a0f5f9ebda260cbad860d9d5f44ca964f8f1cb1b54c290e3c8237d325745fee3a74aaae921c0b237d3c1a991cbf041428f49d04bb2342492dae7058ced727
7
+ data.tar.gz: 8f1da0d936ba3c8d1d57307700a04c685eb90bb6b0b37b5820ad176250de43a2a39a8d7acfdc1cf302f1a28a5acac8daa9c8449473e4c109b3fa1c6ce70c77b1
data/ChangeLog.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # processing ChangeLog
2
2
 
3
3
 
4
+ ## [v0.5.26] - 2023-07-30
5
+
6
+ - add windowOrientation()
7
+
8
+
9
+ ## [v0.5.25] - 2023-07-21
10
+
11
+ - Timer block can call drawing methods
12
+ - Add Processing::Window#update_window, and delete RubySketch::Window class
13
+
14
+
4
15
  ## [v0.5.24] - 2023-07-11
5
16
 
6
17
  - Resize the canvas when the window is resized
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.24
1
+ 0.5.26
@@ -17,6 +17,14 @@ module Processing
17
17
  Touch = Processing::Touch
18
18
  Vector = Processing::Vector
19
19
 
20
+ # Portrait for windowOrientation
21
+ #
22
+ PORTRAIT = :portrait
23
+
24
+ # Landscape for windowOrientation
25
+ #
26
+ LANDSCAPE = :landscape
27
+
20
28
  # @private
21
29
  @@context__ = nil
22
30
 
@@ -53,11 +61,11 @@ module Processing
53
61
  @window__.after_draw = proc {endDraw__}
54
62
  @window__.update_canvas = proc {|i, p| updateCanvas__ i, p}
55
63
 
56
- @window__.instance_variable_set :@context, self
64
+ @window__.instance_variable_set :@context__, self
57
65
 
58
66
  # @private
59
67
  def @window__.draw_screen(painter)
60
- @context.drawImage__ painter
68
+ @context__.drawImage__ painter
61
69
  end
62
70
 
63
71
  drawFrame = -> {
@@ -441,6 +449,16 @@ module Processing
441
449
  nil
442
450
  end
443
451
 
452
+ # Sets window orientation mask
453
+ #
454
+ # @param [PORTRAIT, LANDSCAPE] orientations orientations that window can rotate to
455
+ #
456
+ # @return [nil] nil
457
+ #
458
+ def windowOrientation (*orientations)
459
+ @window__.orientations = orientations.flatten.uniq
460
+ end
461
+
444
462
  # Returns the x position of the window.
445
463
  #
446
464
  # @return [Numeric] horizontal position of the window
@@ -347,6 +347,8 @@ module Processing
347
347
 
348
348
  # Returns the red value of the color.
349
349
  #
350
+ # @param color [Numeric] color value
351
+ #
350
352
  # @return [Numeric] the red value
351
353
  #
352
354
  def red(color)
@@ -355,6 +357,8 @@ module Processing
355
357
 
356
358
  # Returns the green value of the color.
357
359
  #
360
+ # @param color [Numeric] color value
361
+ #
358
362
  # @return [Numeric] the green value
359
363
  #
360
364
  def green(color)
@@ -363,6 +367,8 @@ module Processing
363
367
 
364
368
  # Returns the blue value of the color.
365
369
  #
370
+ # @param color [Numeric] color value
371
+ #
366
372
  # @return [Numeric] the blue value
367
373
  #
368
374
  def blue(color)
@@ -371,6 +377,8 @@ module Processing
371
377
 
372
378
  # Returns the red value of the color.
373
379
  #
380
+ # @param color [Numeric] color value
381
+ #
374
382
  # @return [Numeric] the red value
375
383
  #
376
384
  def alpha(color)
@@ -10,7 +10,7 @@ module Processing
10
10
  :key_down, :key_up,
11
11
  :pointer_down, :pointer_up, :pointer_move,
12
12
  :move, :resize, :motion,
13
- :before_draw, :after_draw, :update_canvas
13
+ :before_draw, :after_draw, :update_window, :update_canvas
14
14
 
15
15
  attr_accessor :auto_resize
16
16
 
@@ -75,6 +75,10 @@ module Processing
75
75
  @active = false
76
76
  end
77
77
 
78
+ def on_update(e)
79
+ draw_canvas {call_block @update_window, e} if @update_window
80
+ end
81
+
78
82
  def on_draw(e)
79
83
  window_painter.pixel_density.tap do |pd|
80
84
  prev, @prev_pixel_density = @prev_pixel_density, pd
data/processing.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.add_runtime_dependency 'xot', '~> 0.1.39'
29
29
  s.add_runtime_dependency 'rucy', '~> 0.1.39'
30
30
  s.add_runtime_dependency 'rays', '~> 0.1.43'
31
- s.add_runtime_dependency 'reflexion', '~> 0.1.49'
31
+ s.add_runtime_dependency 'reflexion', '~> 0.1.50'
32
32
 
33
33
  s.add_development_dependency 'rake'
34
34
  s.add_development_dependency 'test-unit'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: processing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.24
4
+ version: 0.5.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-11 00:00:00.000000000 Z
11
+ date: 2023-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.1.49
61
+ version: 0.1.50
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.1.49
68
+ version: 0.1.50
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement