【发布时间】:2018-11-14 04:43:54
【问题描述】:
我有一个应用程序,我在其中绘制一个矩形,然后将其旋转 90 度。在这种情况下,我有一个可以移动矩形的框架。但是在我转动它(90度的例子)之后,当区域向上移动时,矩形本身就会向右移动。旋转时,形状本身的坐标代理会转动什么? 轮换代码:
this.rotation.addListener((obs, old, fresh) -> {
Rotate rotate = new Rotate((double) fresh - (double) old,
x.getValue().doubleValue() + (width.getValue().doubleValue() / 2),
y.getValue().doubleValue() + (height.getValue().doubleValue() / 2));
shape.getTransforms().add(rotate);
rotate.angleProperty().bind(this.rotation);
});
如何让坐标轴在更新时处于初始位置?
【问题讨论】:
-
您能否在问题中包含更多详细信息。就像你的 Rectangle 的父级是什么一样。并为您的图像提供一些英文描述。我不确定其他人,我无法理解您从第二张和第三张图片中想表达的意思。请提供Minimal, Complete, and Verifiable example
-
不清楚也没有minimal reproducible example。什么是“坐标代理”?哪个区域向上移动?