JavaFX 8 Dynamic Node scaling

前端 未结 1 1254
感动是毒
感动是毒 2021-01-05 06:29

I\'m trying to implement a scene with a ScrollPane in which the user can drag a node around and scale it dynamically. I have the dragging and scaling with the m

1条回答
  •  孤街浪徒
    2021-01-05 07:00

    I found the answer. I was looking at the wrong calculations, assuming it to be related to the translations. The real culprit was the calculation for the difference in scale. I simply changed this:

    double f = (scale / oldScale)-1;

    to this:

    double f = scale - oldScale;

    0 讨论(0)
提交回复
热议问题