Skip to content

Commit

Permalink
Don't change geometry in boundsInParent listener.
Browse files Browse the repository at this point in the history
Fixes #74. Fixes #75.
  • Loading branch information
TomasMikula committed Aug 12, 2014
1 parent cad569f commit 138a629
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ public ParagraphBox(int index, Paragraph<S> par, BiConsumer<Text, S> applyStyle)
getChildren().add(newG);
}
});
boundsInParentProperty().addListener((obs, old, bounds) -> {
graphic.ifPresent(g -> g.relocate(-bounds.getMinX(), 0));
});
}

public Property<Boolean> caretVisibleProperty() { return text.caretVisibleProperty(); }
Expand Down Expand Up @@ -157,11 +154,12 @@ void layoutChildren() {
Bounds bounds = getLayoutBounds();
double w = bounds.getWidth();
double h = bounds.getHeight();
double layoutX = getLayoutX();
double graphicWidth = getGraphicWidth();
text.resizeRelocate(graphicWidth, 0, w - graphicWidth, h);

graphic.ifPresent(g -> {
g.resize(graphicWidth, h);
g.resizeRelocate(-layoutX, 0, graphicWidth, h);
});
}

Expand Down

0 comments on commit 138a629

Please sign in to comment.