processing 0.5.32 → 0.5.34

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.
@@ -3,6 +3,9 @@ module Processing
3
3
 
4
4
  # Font object.
5
5
  #
6
+ # @see https://processing.org/reference/PFont.html
7
+ # @see https://p5js.org/reference/#/p5.Font
8
+ #
6
9
  class Font
7
10
 
8
11
  # @private
@@ -24,6 +27,8 @@ module Processing
24
27
  #
25
28
  # @return [TextBounds] bounding box for text
26
29
  #
30
+ # @see https://p5js.org/reference/#/p5.Font/textBounds
31
+ #
27
32
  def textBounds(str, x = 0, y = 0, fontSize = nil)
28
33
  font = getInternal__ fontSize
29
34
  TextBounds.new x, y, x + font.width(str), y + font.height
@@ -3,6 +3,9 @@ module Processing
3
3
 
4
4
  # Draws graphics into an offscreen buffer
5
5
  #
6
+ # @see https://processing.org/reference/PGraphics.html
7
+ # @see https://p5js.org/reference/#/p5.Graphics
8
+ #
6
9
  class Graphics
7
10
 
8
11
  include Xot::Inspectable
@@ -10,6 +13,8 @@ module Processing
10
13
 
11
14
  # Initialize graphics object.
12
15
  #
16
+ # @see https://p5js.org/reference/#/p5.Graphics
17
+ #
13
18
  def initialize(width, height, pixelDensity = 1)
14
19
  image = Rays::Image.new width, height, Rays::RGBA, pixelDensity
15
20
  init__ image, image.painter
@@ -17,9 +22,11 @@ module Processing
17
22
 
18
23
  # Start drawing.
19
24
  #
25
+ # @see https://processing.org/reference/PGraphics_beginDraw_.html
26
+ #
20
27
  def beginDraw(&block)
21
- beginDraw__
22
28
  @painter__.__send__ :begin_paint
29
+ beginDraw__
23
30
  push
24
31
  if block
25
32
  begin
@@ -32,10 +39,12 @@ module Processing
32
39
 
33
40
  # End drawing.
34
41
  #
42
+ # @see https://processing.org/reference/PGraphics_endDraw_.html
43
+ #
35
44
  def endDraw()
36
45
  pop
37
- @painter__.__send__ :end_paint
38
46
  endDraw__
47
+ @painter__.__send__ :end_paint
39
48
  end
40
49
 
41
50
  end# Graphics