Class: Dcr::View::Compass

Inherits:
Object
  • Object
show all
Includes:
Glimmer::UI::CustomShape
Defined in:
app/views/dcr/compass.rb

Instance Method Summary collapse

Instance Method Details

#angle=(value) ⇒ Object



20
21
22
23
# File 'app/views/dcr/compass.rb', line 20

def angle=(value)
  options[:angle] = value
  apply_transform
end

#apply_transformObject



39
40
41
42
43
# File 'app/views/dcr/compass.rb', line 39

def apply_transform
  body_root.content {
    current_transform
  }
end

#current_transformObject



45
46
47
48
49
50
# File 'app/views/dcr/compass.rb', line 45

def current_transform
  transform {
    translate location_x, location_y
    rotate(angle - 90)
  }
end

#location_x=(value) ⇒ Object



10
11
12
13
# File 'app/views/dcr/compass.rb', line 10

def location_x=(value)
  options[:location_x] = value
  apply_transform
end

#location_y=(value) ⇒ Object



15
16
17
18
# File 'app/views/dcr/compass.rb', line 15

def location_y=(value)
  options[:location_y] = value
  apply_transform
end