Module: Rabbit::Renderer::Display::Magnifier

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

Instance Method Summary collapse

Instance Method Details

#attach_to(window, container = nil) ⇒ Object


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

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

#initialize(canvas) ⇒ Object


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

def initialize(canvas)
  super
  init_magnifier
end

#toggle_magnifierObject


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

def toggle_magnifier
  if magnifying?
    grab
    x, y, mask = pointer
    @magnifier_center_x ||= x
    @magnifier_center_y ||= y
  else
    ungrab
    @magnifier_center_x = nil
    @magnifier_center_y = nil
  end
  queue_draw
end