From 3c45336afe1b3b093129e50942a54261545507ea Mon Sep 17 00:00:00 2001 From: Branislav Stojkovic Date: Tue, 19 Mar 2019 21:26:03 +0100 Subject: [PATCH] rename a function --- .../src/org/diylc/components/AbstractLeadedComponent.java | 6 +++--- .../org/diylc/components/AbstractSchematicLeadedSymbol.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/diylc/diylc-library/src/org/diylc/components/AbstractLeadedComponent.java b/diylc/diylc-library/src/org/diylc/components/AbstractLeadedComponent.java index 6cdd86c1..b59b06f4 100644 --- a/diylc/diylc-library/src/org/diylc/components/AbstractLeadedComponent.java +++ b/diylc/diylc-library/src/org/diylc/components/AbstractLeadedComponent.java @@ -343,10 +343,10 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp double x = (getNewPoints()[0].x + getNewPoints()[1].x - length) / 2.0; double y = (getNewPoints()[0].y + getNewPoints()[1].y - width) / 2.0; g2d.drawString(label, (int) (x + (length - textRect.getWidth()) / 2 + offset), - (int)(y + calculateLabelYCoordinate(shapeRect, textRect, fontMetrics))); + (int)(y + calculateLabelYOffset(shapeRect, textRect, fontMetrics))); } else { g2d.drawString(label, (int) (length - textRect.getWidth()) / 2 + offset, - calculateLabelYCoordinate(shapeRect, textRect, fontMetrics)); + calculateLabelYOffset(shapeRect, textRect, fontMetrics)); g2d.setTransform(oldTransform); } } @@ -438,7 +438,7 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp return false; } - protected int calculateLabelYCoordinate(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics) { + protected int calculateLabelYOffset(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics) { return (int) (shapeRect.getHeight() - textRect.getHeight()) / 2 + fontMetrics.getAscent(); } diff --git a/diylc/diylc-library/src/org/diylc/components/AbstractSchematicLeadedSymbol.java b/diylc/diylc-library/src/org/diylc/components/AbstractSchematicLeadedSymbol.java index e57b0396..f5fd05e5 100644 --- a/diylc/diylc-library/src/org/diylc/components/AbstractSchematicLeadedSymbol.java +++ b/diylc/diylc-library/src/org/diylc/components/AbstractSchematicLeadedSymbol.java @@ -63,7 +63,7 @@ public abstract class AbstractSchematicLeadedSymbol extends AbstractLeadedCom } @Override - protected int calculateLabelYCoordinate(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics) { + protected int calculateLabelYOffset(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics) { if (labelPosition == LabelPosition.ABOVE) { return -5; } else {