processing 0.5.30 → 0.5.32

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: ca6d65b8e9bd003c16fabbf550a70f20f0adf70ea623d1abe01ec1b967b88fa0
4
- data.tar.gz: e4f689b826f7854a4da0bf9b52c6368c27ef02179ae98e15e0995b452eafc096
3
+ metadata.gz: f96427cef5e2add31fe4baa3c6055a94bdff9d126d1ae194cd937c24066d4af4
4
+ data.tar.gz: a4a797bb6246dbb1de3450d6a802ec273553cdf4d5c4b8b2a87e82160f8a22b4
5
5
  SHA512:
6
- metadata.gz: f74584e4c313f4c95ce326ccadd8fa20e59dba80a2b4598f083c7dd5f2041950b8f3d69f0ca34c7fc3021d5b704f26170879587d19d375bb499e244577d529e3
7
- data.tar.gz: a38786a6783135f58ffd9a81edf929f5ba8d020dbd12fc06faa85cc6d36dc95c682249cccea600a823faee81e03b86eb3ffff2ca766704a520f867294cf51ae8
6
+ metadata.gz: 8d39fcf7857c9ad1b10597811adcb23b04f96f1f78e128ff089b2cd7cd1fe4b851ba0ff235813f8946853d940383ec82568300d9a9914ce028fc9d3622d58b4a
7
+ data.tar.gz: 226f9d830533ae9f5836ad447bd84de2bb8939d8a5718d1b43c4f66dc073b776c67c7b5c5ccfa421e9271707a9511568b626a9124b6cfaf65dd61ba95fd88af5
@@ -4,7 +4,6 @@ on:
4
4
  push:
5
5
  branches: [master]
6
6
  pull_request:
7
- branches: [master]
8
7
 
9
8
  jobs:
10
9
  test:
@@ -4,7 +4,6 @@ on:
4
4
  push:
5
5
  branches: [master]
6
6
  pull_request:
7
- branches: [master]
8
7
 
9
8
  jobs:
10
9
  test:
data/ChangeLog.md CHANGED
@@ -1,6 +1,32 @@
1
1
  # processing ChangeLog
2
2
 
3
3
 
4
+ ## [v0.5.32] - 2024-01-08
5
+
6
+ - Add requestImage()
7
+ - Add texture(), textureMode(), and textureWrap()
8
+ - Add loadPixels(), updatePixels(), and pixels()
9
+ - Add curveVertex(), bezierVertex(), and quadraticVertex()
10
+ - Add beginContour() and endContour()
11
+ - Add createFont(), loadFont(), and Font.list()
12
+ - Add Shape#setFill
13
+
14
+ - vertex() can teke UV parameters
15
+ - vertex() records the fill color
16
+ - Drawing shapes with texture is affected by tin() instead of the fill()
17
+
18
+
19
+ ## [v0.5.31] - 2023-12-09
20
+
21
+ - Add Shape class
22
+ - Add createShape(), shape(), shapeMode()
23
+ - Add beginShape(), endShape(), and vertex(x, y)
24
+ - Test with p5.rb
25
+ - GraphicsContext#rotate() can take z parameter
26
+ - Set default miter_limit to 10
27
+ - Trigger github actions on all pull_request
28
+
29
+
4
30
  ## [v0.5.30] - 2023-11-09
5
31
 
6
32
  - Test drawing methods with p5.rb
data/Rakefile CHANGED
@@ -14,12 +14,16 @@ require 'reflex/extension'
14
14
  require 'processing/extension'
15
15
 
16
16
 
17
- EXTENSIONS = [Xot, Rucy, Rays, Reflex, Processing]
18
- DRAW_TESTS = Dir.glob('test/draw/test_*.rb')
19
- TESTS_EXCLUDE = DRAW_TESTS
17
+ def test_with_p5()
18
+ ENV['TEST_WITH_P5'] = '1'
19
+ end
20
+
21
+ EXTENSIONS = [Xot, Rucy, Rays, Reflex, Processing]
20
22
 
21
23
  ENV['RDOC'] = 'yardoc --no-private'
22
24
 
25
+ #test_with_p5 if ci?
26
+
23
27
  default_tasks
24
28
  use_bundler
25
29
  test_ruby_extension
@@ -30,10 +34,14 @@ task :clean => 'test:clean'
30
34
 
31
35
  namespace :test do
32
36
  task :clean do
33
- sh %( rm -rf test/draw/p5rb )
37
+ sh %( rm -rf test/.png/*.png )
38
+ end
39
+
40
+ task :with_p5 do
41
+ test_with_p5
34
42
  end
35
43
 
36
- task :draw do
37
- sh %( ruby #{DRAW_TESTS.join ' '} )
44
+ ::Rake::TestTask.new :draw do |t|
45
+ t.test_files = FileList['test/test_*.rb']
38
46
  end
39
47
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.30
1
+ 0.5.32
@@ -14,6 +14,7 @@ require 'processing/vector'
14
14
  require 'processing/image'
15
15
  require 'processing/font'
16
16
  require 'processing/touch'
17
+ require 'processing/shape'
17
18
  require 'processing/shader'
18
19
  require 'processing/capture'
19
20
  require 'processing/graphics_context'
@@ -7,7 +7,8 @@ module Processing
7
7
 
8
8
  # @private
9
9
  def initialize(font)
10
- @font = font
10
+ @font = font or raise ArgumentError
11
+ @cachedSizes = {}
11
12
  end
12
13
 
13
14
  # Returns bounding box.
@@ -24,8 +25,8 @@ module Processing
24
25
  # @return [TextBounds] bounding box for text
25
26
  #
26
27
  def textBounds(str, x = 0, y = 0, fontSize = nil)
27
- f = fontSize ? Rays::Font.new(@font.name, fontSize) : @font
28
- TextBounds.new x, y, x + f.width(str), y + f.height
28
+ font = getInternal__ fontSize
29
+ TextBounds.new x, y, x + font.width(str), y + font.height
29
30
  end
30
31
 
31
32
  # Returns a string containing a human-readable representation of object.
@@ -36,6 +37,32 @@ module Processing
36
37
  "#<Processing::Font: name:'#{@font.name}' size:#{@font.size}>"
37
38
  end
38
39
 
40
+ # Returns available font names
41
+ #
42
+ # @return [String] font names
43
+ #
44
+ # @see https://processing.org/reference/PFont_list_.html
45
+ #
46
+ def self.list()
47
+ Rays::Font.families.values.flatten
48
+ end
49
+
50
+ # @private
51
+ def getInternal__(size = nil)
52
+ if size
53
+ @cachedSizes[size.to_f] ||= @font.dup.tap {|font| font.size = size}
54
+ else
55
+ @font
56
+ end
57
+ end
58
+
59
+ # @private
60
+ def setSize__(size)
61
+ return if size == @font.size
62
+ @cachedSizes[@font.size] = @font
63
+ @font = getInternal__ size
64
+ end
65
+
39
66
  end# Font
40
67
 
41
68
 
@@ -38,17 +38,6 @@ module Processing
38
38
  endDraw__
39
39
  end
40
40
 
41
- # Saves image to file.
42
- #
43
- # @param filename [String] file name to save image
44
- #
45
- # @return [nil] nil
46
- #
47
- def save(filename)
48
- @image__.save filename
49
- nil
50
- end
51
-
52
41
  end# Graphics
53
42
 
54
43