Class: Pango::Rectangle

Inherits:
Object
  • Object
show all
Extended by:
GLib::Deprecatable
Defined in:
lib/pango/rectangle.rb,
lib/pango/deprecated.rb

Instance Method Summary collapse

Constructor Details

#initialize(x, y, width, height) ⇒ Rectangle

Returns a new instance of Rectangle.



20
21
22
23
24
25
26
# File 'lib/pango/rectangle.rb', line 20

def initialize(x, y, width, height)
  initialize_raw
  self.x = x
  self.y = y
  self.width = width
  self.height = height
end

Instance Method Details

#ascentObject



28
29
30
# File 'lib/pango/rectangle.rb', line 28

def ascent
  -y
end

#descentObject



32
33
34
# File 'lib/pango/rectangle.rb', line 32

def descent
  y + height
end

#dupObject



48
49
50
51
52
# File 'lib/pango/rectangle.rb', line 48

def dup
  duplicated = self.class.new(x, y, width, height)
  duplicated.taint if tainted?
  duplicated
end

#initialize_rawObject



19
# File 'lib/pango/rectangle.rb', line 19

alias_method :initialize_raw, :initialize

#left_bearingObject



36
37
38
# File 'lib/pango/rectangle.rb', line 36

def left_bearing
  x
end

#right_bearingObject



40
41
42
# File 'lib/pango/rectangle.rb', line 40

def right_bearing
  x + width
end

#to_aObject



44
45
46
# File 'lib/pango/rectangle.rb', line 44

def to_a
  [x, y, width, height]
end