Class: Ruflet::Events::ScaleUpdateEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::ScaleUpdateEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#focal_point_delta ⇒ Object
readonly
Returns the value of attribute focal_point_delta.
-
#global_focal_point ⇒ Object
readonly
Returns the value of attribute global_focal_point.
-
#horizontal_scale ⇒ Object
readonly
Returns the value of attribute horizontal_scale.
-
#local_focal_point ⇒ Object
readonly
Returns the value of attribute local_focal_point.
-
#pointer_count ⇒ Object
readonly
Returns the value of attribute pointer_count.
-
#rotation ⇒ Object
readonly
Returns the value of attribute rotation.
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#vertical_scale ⇒ Object
readonly
Returns the value of attribute vertical_scale.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(local_focal_point:, global_focal_point:, focal_point_delta:, pointer_count:, horizontal_scale:, vertical_scale:, scale:, rotation:, timestamp:) ⇒ ScaleUpdateEvent
constructor
A new instance of ScaleUpdateEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(local_focal_point:, global_focal_point:, focal_point_delta:, pointer_count:, horizontal_scale:, vertical_scale:, scale:, rotation:, timestamp:) ⇒ ScaleUpdateEvent
Returns a new instance of ScaleUpdateEvent.
322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 322 def initialize(local_focal_point:, global_focal_point:, focal_point_delta:, pointer_count:, horizontal_scale:, vertical_scale:, scale:, rotation:, timestamp:) @local_focal_point = local_focal_point @global_focal_point = global_focal_point @focal_point_delta = focal_point_delta @pointer_count = pointer_count @horizontal_scale = horizontal_scale @vertical_scale = vertical_scale @scale = scale @rotation = rotation @timestamp = end |
Instance Attribute Details
#focal_point_delta ⇒ Object (readonly)
Returns the value of attribute focal_point_delta.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def focal_point_delta @focal_point_delta end |
#global_focal_point ⇒ Object (readonly)
Returns the value of attribute global_focal_point.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def global_focal_point @global_focal_point end |
#horizontal_scale ⇒ Object (readonly)
Returns the value of attribute horizontal_scale.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def horizontal_scale @horizontal_scale end |
#local_focal_point ⇒ Object (readonly)
Returns the value of attribute local_focal_point.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def local_focal_point @local_focal_point end |
#pointer_count ⇒ Object (readonly)
Returns the value of attribute pointer_count.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def pointer_count @pointer_count end |
#rotation ⇒ Object (readonly)
Returns the value of attribute rotation.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def rotation @rotation end |
#scale ⇒ Object (readonly)
Returns the value of attribute scale.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def scale @scale end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def @timestamp end |
#vertical_scale ⇒ Object (readonly)
Returns the value of attribute vertical_scale.
318 319 320 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 318 def vertical_scale @vertical_scale end |
Class Method Details
.from_data(data) ⇒ Object
334 335 336 337 338 339 340 341 342 343 344 345 346 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 334 def self.from_data(data) new( local_focal_point: offset(data, "lfp", "local_focal_point"), global_focal_point: offset(data, "gfp", "global_focal_point"), focal_point_delta: offset(data, "fpd", "focal_point_delta"), pointer_count: pick(data, "pc", "pointer_count"), horizontal_scale: pick(data, "hs", "horizontal_scale"), vertical_scale: pick(data, "vs", "vertical_scale"), scale: pick(data, "s", "scale"), rotation: pick(data, "rot", "rotation"), timestamp: duration(data, "ts", "timestamp") ) end |