Skip to content

Commit

Permalink
prmr#413 Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yannsartori authored and louib committed Aug 15, 2021
1 parent 3d8e901 commit 9c915c9
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 9c915c9

Please sign in to comment.