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

Node.localToSceneTransform() + SubScene.localToSceneTransform() not equivalent to Node.localToScene(x,y,true)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 8u40
    • javafx

      Symptoms are similar to RT-35952 but with SubScene in the picture.

      I updated SB2 so that it uses a SubScene object to isolate the user scene graph
      from its own scene graph. So basically I have this:

               ScrollPane
                      ...
                             SubScene
                                       <user-scene-graph-root>
                                               ...
                                                  <some-node>

      If i compute the following points:

          p1 = someNode.localToScene(0, 0, true /* rootScene */)

      and

          pt = someNode.getLocalToSceneTransform().transform(0, 0)
          p2 = subScene.getLocalToSceneTransform().transform(pt)

      I don't get the equality (with the numeric tolerance):

          p1 == p2



      It can be reproduced using latest source of SB and the attached path (SubSceneTransform.diff).
      Here are the steps:

      1) Check the latest SB sources
      2) Apply SubSceneTransform.diff
      3) Setup your IDE with SB and your latest FX source
      4) Start SB from the IDE
      5) Enabled SB debug menu
             5.1) Help -> About
             5.2) Press Alt+Shift and double click the JavaFX logo
             5.3) Close the About window
                    => you should see the Debug menu at the right end of the menu bar
      6) Drop an AnchorPane from Library to Content panel
      7) Drop a Button in the AnchorPane
           => selection handles and target ring (orange rectangle) are bizarrely placed
           => this is a side effect of the issue described here
      8) Debug -> Check localToSceneTransform Properties in Content Panel
          => this command checks the equality mentioned above for all the objects
               in the content panel (i.e. below the dark background)
          => you should see the following output


      CHECK LOCAL TO SCENE TRANSFORM BEGINS
      CHECK FAILED FOR ScrollPane[id=scrollPane, styleClass=scroll-pane edge-to-edge theme-presets SBKIT-content-panel], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR ScrollPaneSkin$3@33a4ac7e[styleClass=viewport], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR ScrollPaneSkin$4@676974ca, p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR StackPane[id=workspacePane], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Group[id=Group], p1=Point2D [x = 320.0, y = 205.0], p2=Point2D [x = 640.0, y = 410.0]
      CHECK FAILED FOR Group[id=scalingGroup], p1=Point2D [x = 320.0, y = 205.0], p2=Point2D [x = 640.0, y = 410.0]
      CHECK FAILED FOR Rectangle[id=extensionRect, x=-20.0, y=-20.0, width=640.0, height=440.0, fill=0xffc0cb00, stroke=0x00000000, strokeWidth=1.0], p1=Point2D [x = 320.0, y = 205.0], p2=Point2D [x = 640.0, y = 410.0]
      CHECK FAILED FOR Label[id=backgroundPane, styleClass=stage-prompt-default]'', p1=Point2D [x = 320.0, y = 205.0], p2=Point2D [x = 640.0, y = 410.0]
      CHECK FAILED FOR Text[text="", x=0.0, y=0.0, alignment=CENTER, origin=BASELINE, boundsType=LOGICAL_VERTICAL_CENTER, font=Font[name=System Regular, family=System, style=Regular, size=16.0], fontSmoothingType=LCD, fill=0x4a4a4aff], p1=Point2D [x = 620.0, y = 421.0], p2=Point2D [x = 940.0, y = 626.0]
      CHECK FAILED FOR SubScene[id=contentSubScene], p1=Point2D [x = 320.0, y = 205.0], p2=Point2D [x = 640.0, y = 410.0]
      CHECK FAILED FOR Button@6c35471f[styleClass=button]'Button', p1=Point2D [x = 589.9999995529652, y = 392.00000047683716], p2=Point2D [x = 590.0, y = 392.0]
      CHECK FAILED FOR Pane[id=glassLayer], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Group[id=outlineLayer], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Group[id=pringLayer], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Group@9d8cb58[styleClass=theme-presets SBKIT-content-panel], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Path[elements=[MoveTo[x=-281.0, y=-32.0], LineTo[x=319.0, y=-32.0], LineTo[x=319.0, y=368.0], LineTo[x=-281.0, y=368.0], ClosePath], fill=null, fillRule=NON_ZERO, stroke=0xeea82fff, strokeWidth=7.0], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Group[id=handleLayer], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Group@2298b6ce[styleClass=theme-presets SBKIT-content-panel], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Path[elements=[MoveTo[x=-11.0, y=155.0], LineTo[x=49.0, y=155.0], LineTo[x=49.0, y=181.0], LineTo[x=-11.0, y=181.0], ClosePath], fill=0x0000000d, fillRule=NON_ZERO], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR ImageView@11ecc56e[styleClass=image-view], p1=Point2D [x = 270.0, y = 187.0], p2=Point2D [x = 590.0, y = 392.0]
      CHECK FAILED FOR ImageView@7dcb6c7a[styleClass=image-view], p1=Point2D [x = 330.0, y = 187.0], p2=Point2D [x = 650.0, y = 392.0]
      CHECK FAILED FOR ImageView@3206fa90[styleClass=image-view], p1=Point2D [x = 330.0, y = 213.0], p2=Point2D [x = 650.0, y = 418.0]
      CHECK FAILED FOR ImageView@2a1433f[styleClass=image-view], p1=Point2D [x = 270.0, y = 213.0], p2=Point2D [x = 590.0, y = 418.0]
      CHECK FAILED FOR ImageView@751131b0[styleClass=image-view], p1=Point2D [x = 306.0, y = 187.0], p2=Point2D [x = 626.0, y = 392.0]
      CHECK FAILED FOR ImageView@531f2bd4[styleClass=image-view], p1=Point2D [x = 330.0, y = 205.0], p2=Point2D [x = 650.0, y = 410.0]
      CHECK FAILED FOR ImageView@5648995d[styleClass=image-view], p1=Point2D [x = 295.0, y = 213.0], p2=Point2D [x = 615.0, y = 418.0]
      CHECK FAILED FOR ImageView@5ef89010[styleClass=image-view], p1=Point2D [x = 270.0, y = 194.0], p2=Point2D [x = 590.0, y = 399.0]
      CHECK FAILED FOR Group[id=rudderLayer], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR ScrollBar@7369ffc7[styleClass=scroll-bar], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR StackPane@80656cb[styleClass=track-background], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR ScrollBarSkin$2@6954651f[styleClass=increment-button], p1=Point2D [x = 281.0, y = 130.0], p2=Point2D [x = 601.0, y = 335.0]
      CHECK FAILED FOR Region@73117244[styleClass=increment-arrow], p1=Point2D [x = 290.0, y = 131.0], p2=Point2D [x = 610.0, y = 336.0]
      CHECK FAILED FOR ScrollBarSkin$3@11afa923[styleClass=decrement-button], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Region@79d69ad7[styleClass=decrement-arrow], p1=Point2D [x = 290.0, y = 33.0], p2=Point2D [x = 610.0, y = 238.0]
      CHECK FAILED FOR StackPane@5ce299e3[styleClass=track], p1=Point2D [x = 281.0, y = 34.0], p2=Point2D [x = 601.0, y = 239.0]
      CHECK FAILED FOR ScrollBarSkin$1@66e83cba[styleClass=thumb], p1=Point2D [x = 281.0, y = 34.0], p2=Point2D [x = 601.0, y = 239.0]
      CHECK FAILED FOR ScrollBar@5f0a1a44[styleClass=scroll-bar], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR StackPane@6b007c40[styleClass=track-background], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR ScrollBarSkin$2@3b31f86b[styleClass=increment-button], p1=Point2D [x = 299.0, y = 32.0], p2=Point2D [x = 619.0, y = 237.0]
      CHECK FAILED FOR Region@4f8b8be1[styleClass=increment-arrow], p1=Point2D [x = 300.0, y = 82.0], p2=Point2D [x = 620.0, y = 287.0]
      CHECK FAILED FOR ScrollBarSkin$3@28f6a86f[styleClass=decrement-button], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK FAILED FOR Region@81f1cd4[styleClass=decrement-arrow], p1=Point2D [x = 282.0, y = 82.0], p2=Point2D [x = 602.0, y = 287.0]
      CHECK FAILED FOR StackPane@58ffe819[styleClass=track], p1=Point2D [x = 283.0, y = 32.0], p2=Point2D [x = 603.0, y = 237.0]
      CHECK FAILED FOR ScrollBarSkin$1@30f56d3a[styleClass=thumb], p1=Point2D [x = 278.0, y = 32.0], p2=Point2D [x = 598.0, y = 237.0]
      CHECK FAILED FOR StackPane@5d17c856[styleClass=corner], p1=Point2D [x = 281.0, y = 32.0], p2=Point2D [x = 601.0, y = 237.0]
      CHECK LOCAL TO SCENE TRANSFORM ENDS

            msladecek Martin Sládeček
            eleponn Eric Le Ponner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: