• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

How can i calculate the correct drag x,y position when rotate parent with style "-fx-rotate"

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

i have problem whe I set style “fx-rotate” on the parents or parent.parent…. of the children node.
I have have a node with a drag listener which calculate the drag translateX, translateY.
It works fine and also works fine when i set for example node.setStyle("fx-rotate: 30").
But whne set the style on root.setStyle("fx-rotate: 30") or
parent.setStyle("fx-rotate: 30") the drag listener work incorect.
What can i do or have you an idea how can calculate the correct tranlatex, translatey
when the parent of node have an rotation on it’s style?

Here is an Example Code of my problem

Next exmple when i set style on each other parent of node the calculation is wrong

Thanks for your help
She'll be back. I'm just gonna wait here. With this tiny ad:
Enterprise-grade Excel API for Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!