Module: Gdk::EventCoordsReader

Defined in:
lib/gdk3/event-readers.rb

Instance Method Summary collapse

Instance Method Details

#centerObject



87
88
89
90
91
92
93
94
# File 'lib/gdk3/event-readers.rb', line 87

def center
  calculated, x, y = super
  if calculated
    [x, y]
  else
    nil
  end
end

#coordsObject



52
53
54
55
56
57
58
59
# File 'lib/gdk3/event-readers.rb', line 52

def coords
  found, x, y = super
  if found
    [x, y]
  else
    nil
  end
end

#get_angle(other_event) ⇒ Object



78
79
80
81
82
83
84
85
# File 'lib/gdk3/event-readers.rb', line 78

def get_angle(other_event)
  calculated, angle = Event.get_angle(self, other_event)
  if calculated
    angle
  else
    nil
  end
end

#get_distance(other_event) ⇒ Object



69
70
71
72
73
74
75
76
# File 'lib/gdk3/event-readers.rb', line 69

def get_distance(other_event)
  calculated, distance = Event.get_distance(self, other_event)
  if calculated
    distance
  else
    nil
  end
end

#xObject



61
62
63
# File 'lib/gdk3/event-readers.rb', line 61

def x
  (coords || [])[0]
end

#yObject



65
66
67
# File 'lib/gdk3/event-readers.rb', line 65

def y
  (coords || [])[1]
end