• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How calculate the real x/y in a transformed/roated node

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello JavaFX friends,

i need the real layoutX/layoutY in a transformed...(rotaded) node.

My problem is, i have a rotated node (in my example a pane) and add a label to the pane.
When i set the layoutX value ... the label is shift  the layoutY and not the x
coordinate? :eek:

Is it possible to get the reverse calculated bound from the
transformed pane?. So that can set the real x and y.

Her is the Example Application



My workaround is to use  label.getTransforms().add(new Translate(x,y)).
But in my drawing pane i have over 1000 shapes with labels and my worry
is thats become inperformant, than i set on each label the tanslate(x,y) transform.

Thanks for your help and greetings
sebastian
 
Sheriff
Posts: 6128
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My workaround is to use  label.getTransforms().add(new Translate(x,y)).
But in my drawing pane i have over 1000 shapes with labels and my worry
is thats become inperformant, than i set on each label the tanslate(x,y) transform.


This seems to be the correct way to move a rotated shape.  Why do you think it won't perform well?  You may be falling in the premature optimization trap.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!