Class: Rect

Inherits:
Object show all
Defined in:
lib/droiuby/wrappers/canvas_wrapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(rect = nil, left = 0, top = 0, right = 0, bottom = 0) ⇒ Rect

Returns a new instance of Rect.



3
4
5
6
7
8
9
10
# File 'lib/droiuby/wrappers/canvas_wrapper.rb', line 3

def initialize(rect = nil, left = 0, top = 0, right = 0, bottom = 0)
  if (rect.nil?)
    @native = Java::android.graphics.Rect.new(left, top, right, bottom)
  else
    @native = rect
  end

end

Instance Method Details

#heightObject



16
17
18
# File 'lib/droiuby/wrappers/canvas_wrapper.rb', line 16

def height
  @native.height
end

#nativeObject



12
13
14
# File 'lib/droiuby/wrappers/canvas_wrapper.rb', line 12

def native
  @native
end

#set(left, top, right, bottom) ⇒ Object



24
25
26
# File 'lib/droiuby/wrappers/canvas_wrapper.rb', line 24

def set(left, top, right, bottom)
  @native.set(left, top, right, bottom)
end

#widthObject



20
21
22
# File 'lib/droiuby/wrappers/canvas_wrapper.rb', line 20

def width
  @native.width
end