Class: Ruflet::Events::ScaleStartEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::ScaleStartEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#global_focal_point ⇒ Object
readonly
Returns the value of attribute global_focal_point.
-
#local_focal_point ⇒ Object
readonly
Returns the value of attribute local_focal_point.
-
#pointer_count ⇒ Object
readonly
Returns the value of attribute pointer_count.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(local_focal_point:, global_focal_point:, pointer_count:, timestamp:) ⇒ ScaleStartEvent
constructor
A new instance of ScaleStartEvent.
Methods inherited from BasePayload
duration, offset, offset_pair, pick, stringify_keys
Constructor Details
#initialize(local_focal_point:, global_focal_point:, pointer_count:, timestamp:) ⇒ ScaleStartEvent
Returns a new instance of ScaleStartEvent.
399 400 401 402 403 404 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 399 def initialize(local_focal_point:, global_focal_point:, pointer_count:, timestamp:) @local_focal_point = local_focal_point @global_focal_point = global_focal_point @pointer_count = pointer_count @timestamp = end |
Instance Attribute Details
#global_focal_point ⇒ Object (readonly)
Returns the value of attribute global_focal_point.
397 398 399 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 397 def global_focal_point @global_focal_point end |
#local_focal_point ⇒ Object (readonly)
Returns the value of attribute local_focal_point.
397 398 399 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 397 def local_focal_point @local_focal_point end |
#pointer_count ⇒ Object (readonly)
Returns the value of attribute pointer_count.
397 398 399 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 397 def pointer_count @pointer_count end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
397 398 399 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 397 def @timestamp end |
Class Method Details
.from_data(data) ⇒ Object
406 407 408 409 410 411 412 413 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 406 def self.from_data(data) new( local_focal_point: offset(data, "lfp", "local_focal_point"), global_focal_point: offset(data, "gfp", "global_focal_point"), pointer_count: pick(data, "pc", "pointer_count"), timestamp: duration(data, "ts", "timestamp") ) end |