Skip to content

Commit

Permalink
#413 Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yannsartori authored and prmr committed Feb 16, 2021
1 parent 08860cf commit 1be419a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ca/mcgill/cs/jetuml/views/FontMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public FontMetrics(Font pFont)
}

/**
* Returns the dimension of this string.
* Returns the dimension of a given string.
* @param pString The string to which the bounds pertain.
* @return The dimension of the string
*/
Expand All @@ -80,6 +80,6 @@ public Dimension getDimension(String pString)
Bounds bounds = aTextNode.getLayoutBounds();
aTextNode.setText(BLANK);
double leading = aTextNode.getLayoutBounds().getMaxY();
return new Dimension((int) bounds.getWidth(), (int) (bounds.getHeight() - leading));
return new Dimension((int) Math.round(bounds.getWidth()), (int) Math.round(bounds.getHeight() - leading));
}
}

0 comments on commit 1be419a

Please sign in to comment.