Class: Reight::SoundEditor::Eraser
- Defined in:
- lib/reight/app/sound/eraser.rb
Instance Attribute Summary
Attributes inherited from Tool
Attributes inherited from Button
Instance Method Summary collapse
- #canvas_dragged(x, y, button) ⇒ Object
- #canvas_pressed(x, y, button) ⇒ Object
- #canvas_released(x, y, button) ⇒ Object
- #erase(x, y, button) ⇒ Object
-
#initialize(app, &block) ⇒ Eraser
constructor
A new instance of Eraser.
Methods inherited from Tool
#canvas, #canvas_clicked, #canvas_moved, #history, #name, #pick_tone
Methods inherited from Button
#click, #disabled?, #disabled_icon, #draw, #enabled?, #hover, #pressed, #pressing?, #released, #sprite
Methods included from HasHelp
Methods included from Hookable
Methods included from Activatable
#activated, #activated!, #active=, #active?
Constructor Details
#initialize(app, &block) ⇒ Eraser
Returns a new instance of Eraser.
3 4 5 6 |
# File 'lib/reight/app/sound/eraser.rb', line 3 def initialize(app, &block) super app, icon: app.icon(3, 2, 8), &block set_help left: name end |
Instance Method Details
#canvas_dragged(x, y, button) ⇒ Object
23 24 25 26 |
# File 'lib/reight/app/sound/eraser.rb', line 23 def canvas_dragged(x, y, ) return unless == LEFT erase x, y, end |
#canvas_pressed(x, y, button) ⇒ Object
12 13 14 15 16 |
# File 'lib/reight/app/sound/eraser.rb', line 12 def canvas_pressed(x, y, ) return unless == LEFT canvas.begin_editing erase x, y, end |
#canvas_released(x, y, button) ⇒ Object
18 19 20 21 |
# File 'lib/reight/app/sound/eraser.rb', line 18 def canvas_released(x, y, ) return unless == LEFT canvas.end_editing end |
#erase(x, y, button) ⇒ Object
8 9 10 |
# File 'lib/reight/app/sound/eraser.rb', line 8 def erase(x, y, ) canvas.delete x, y end |