From 9c915c9afec27ea1d5df0c58d652cc3453b09b3c Mon Sep 17 00:00:00 2001 From: Yann Sartori Date: Mon, 15 Feb 2021 17:42:21 -0500 Subject: [PATCH] #413 Address PR comments --- src/ca/mcgill/cs/jetuml/views/FontMetrics.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ca/mcgill/cs/jetuml/views/FontMetrics.java b/src/ca/mcgill/cs/jetuml/views/FontMetrics.java index 058cb7d8c..6143631f2 100644 --- a/src/ca/mcgill/cs/jetuml/views/FontMetrics.java +++ b/src/ca/mcgill/cs/jetuml/views/FontMetrics.java @@ -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 */ @@ -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)); } } \ No newline at end of file