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, pick, stringify_keys
Constructor Details
#initialize(local_focal_point:, global_focal_point:, pointer_count:, timestamp:) ⇒ ScaleStartEvent
Returns a new instance of ScaleStartEvent.
300 301 302 303 304 305 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 300 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.
298 299 300 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 298 def global_focal_point @global_focal_point end |
#local_focal_point ⇒ Object (readonly)
Returns the value of attribute local_focal_point.
298 299 300 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 298 def local_focal_point @local_focal_point end |
#pointer_count ⇒ Object (readonly)
Returns the value of attribute pointer_count.
298 299 300 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 298 def pointer_count @pointer_count end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
298 299 300 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 298 def @timestamp end |
Class Method Details
.from_data(data) ⇒ Object
307 308 309 310 311 312 313 314 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 307 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 |