Concatenating transforms to scale positions but not objects (the original question)

Mark Raynsford org.openjdk at
Thu Aug 15 14:25:05 UTC 2019


While a decision is being made as to where exactly to ask questions
about JavaFX, I'd like to return to my original question because this
is really looking to me like a bug in JavaFX, or some rather nasty
limitation of the transform system. The reason for this is that the
external/internal pane setup seems to cause almost everything involved
to behave phenomenally badly (including external applications that
traverse the scene graph like ScenicView).

See the original gist:

I would like, as a polite challenge, for someone to have a go at, for
example, placing a view (such as a button) inside any of the pane
objects and making it fill the 128x128 space fully - perhaps by changing
one of the panes to an AnchorPane and setting appropriate constraints.
As far as I can tell, it can't be done. It seems that the transform
setup is causing JavaFX to become confused at some fundamental level.
It's almost as if the code responsible for doing the layout is not
taking the transforms into account and so treats the space as if it
were a 1x1 scene pixel area.

The problem with this whole thing is that if I can't solve this problem,
then the only apparent alternative for me is to express everything in my
interface in terms of scene pixels and then _iterate over every
object and manually change transforms every time anyone scrolls or
zooms_. Being forced to do that would seem to suggest that something
about the JavaFX scene graph is very much not fit for purpose here.

Annoyingly, this would be a fairly trivial job if I just fell back to
rendering with OpenGL/Vulkan directly with an orthographic projection
(of course, then I'd have to do all my own input handling, so I'd
rather not).

Mark Raynsford |

More information about the openjfx-discuss mailing list