permalmberg
01/04/2017, 6:39 PMclass WireView(source: OutputView, target: InputView) : Line() I want to bind the `startX/Y `and endX/Y properties to another view so that the ends of the line moves when the other view. As such, in the other view (a Fragment) I do:
override fun bindPosition(wire: WireView) {
wire.endXProperty().bind( root.layoutXProperty())
wire.endYProperty().bind( root.layoutYProperty())
}
The binding in it self seems to work, but the problem is that root.layoutX is local to that Fragment. Is there an easy way to transform the local coordinate system to that of the view that the Fragment is contained by? As I type this, I remember reading about using a converter for bindings, perhaps that is the way?