Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8091104

ScrollEvents and SwipeEvent do not consider rotated UI Elements

XMLWordPrintable

      When a Element with a ScrollPane (e.g. a TextArea or a WebView) is freely rotated on the screen, the ScrollEvents do not account for this rotation. The same way, a SwipeEvent only has an absolute direction in respect to the Screen, and not in respect to a Node.

      We use JavaFX in a setup with an Interactive Tabletop. If in our setup a scrollable Control (e.g. a WebView) is rotated - for example around 90 degree - the calculation of the Scroll direction does not account for this rotation. That is, a horizontal ScrollGesture in respect to the content of the WebView will result in a vertical scrolling behaviour.

      We fixed this issues for us by calculating the angle from the localToSceneTransform of the node, and applying the inverse RotateTransform to the DeltaX and DeltaY values in a Skin for ScrollPane. We also used the angle to correct the direction of the SwipeEvent relative to a node.

      This behaviour is at least helpful when programming for larger multi-touch surfaces and tables - and so far does not interfere with desktop usage or usage on small touch devices.

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported: