Skip to content

Commit

Permalink
Fix height paragraph box height calculation
Browse files Browse the repository at this point in the history
The insets were removed from the "overhead" when they should have been
added. This was asking the text for its preferred height if it had
(width + insets) space, rather than (width - insets).

Because of this, some paragraphs give a preferred height of one line
less than they should (because they wouldn't need to wrap given the
extra space that's actually occupied by the insets).

Closes #809
  • Loading branch information
csmith committed Mar 25, 2019
1 parent 94a7ee7 commit 75577f9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ protected double computePrefWidth(double ignoredHeight) {
@Override
protected double computePrefHeight(double width) {
Insets insets = getInsets();
double overhead = getGraphicPrefWidth() - insets.getLeft() - insets.getRight();
double overhead = getGraphicPrefWidth() + insets.getLeft() + insets.getRight();
return text.prefHeight(width - overhead) + insets.getTop() + insets.getBottom();
}

Expand Down

0 comments on commit 75577f9

Please sign in to comment.