Module: Rabbit::Renderer::Display::Spotlight

Included in:
ClutterEmbed, DrawingAreaBase
Defined in:
lib/rabbit/renderer/display/spotlight.rb

Instance Method Summary collapse

Instance Method Details

#attach_to(window, container = nil) ⇒ Object



10
11
12
13
# File 'lib/rabbit/renderer/display/spotlight.rb', line 10

def attach_to(window, container=nil)
  super
  spotlight_action.active = false
end

#initialize(canvas) ⇒ Object



5
6
7
8
# File 'lib/rabbit/renderer/display/spotlight.rb', line 5

def initialize(canvas)
  super
  init_spotlight
end

#toggle_spotlightObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rabbit/renderer/display/spotlight.rb', line 15

def toggle_spotlight
  if spotlighting?
    grab
    x, y, mask = pointer
    @spotlight_center_x ||= x
    @spotlight_center_y ||= y
  else
    ungrab
    @spotlight_center_x = nil
    @spotlight_center_y = nil
  end
  queue_draw
end