Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt +15 −7 Original line number Diff line number Diff line Loading @@ -138,11 +138,26 @@ internal class MultiPointerDraggableNode( } } private var _toFloat = orientation.toFunctionOffsetToFloat() private fun Offset.toFloat(): Float = _toFloat(this) private fun Orientation.toFunctionOffsetToFloat(): (Offset) -> Float = when (this) { Orientation.Vertical -> { { it.y } } Orientation.Horizontal -> { { it.x } } } var orientation: Orientation = orientation set(value) { // Reset the pointer input whenever orientation changed. if (value != field) { field = value _toFloat = field.toFunctionOffsetToFloat() delegate.resetPointerInputHandler() } } Loading Loading @@ -367,13 +382,6 @@ internal class MultiPointerDraggableNode( return event } private fun Offset.toFloat(): Float { return when (orientation) { Orientation.Vertical -> y Orientation.Horizontal -> x } } /** * Continues to read drag events until all pointers are up or the drag event is canceled. The * initial pointer to use for driving the drag is [initialPointerId]. [hasDragged] passes the Loading Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/MultiPointerDraggable.kt +15 −7 Original line number Diff line number Diff line Loading @@ -138,11 +138,26 @@ internal class MultiPointerDraggableNode( } } private var _toFloat = orientation.toFunctionOffsetToFloat() private fun Offset.toFloat(): Float = _toFloat(this) private fun Orientation.toFunctionOffsetToFloat(): (Offset) -> Float = when (this) { Orientation.Vertical -> { { it.y } } Orientation.Horizontal -> { { it.x } } } var orientation: Orientation = orientation set(value) { // Reset the pointer input whenever orientation changed. if (value != field) { field = value _toFloat = field.toFunctionOffsetToFloat() delegate.resetPointerInputHandler() } } Loading Loading @@ -367,13 +382,6 @@ internal class MultiPointerDraggableNode( return event } private fun Offset.toFloat(): Float { return when (orientation) { Orientation.Vertical -> y Orientation.Horizontal -> x } } /** * Continues to read drag events until all pointers are up or the drag event is canceled. The * initial pointer to use for driving the drag is [initialPointerId]. [hasDragged] passes the Loading