From e831de8910264cd455d02369f1fe6b11dfcf8e9d Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Wed, 23 Oct 2019 15:41:56 +0200
Subject: [PATCH] font size was inproperly taken

---
 CHANGELOG                                                  | 4 ++++
 .../bioEntity/element/species/SpeciesConverter.java        | 7 ++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 64ccace374..4c2cfd9bd3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+minerva (15.0.0~alpha.0) stable; urgency=medium
+  * Bug fix: position of structural state is preserved on upload CellDesigner 
+    file (#671)
+
 minerva (14.0.3) stable; urgency=medium
   * Bug fix: default zoom level on main map works even when x or y are
     undefined (#993)
diff --git a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/SpeciesConverter.java b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/SpeciesConverter.java
index 6f553354fd..65cf866433 100644
--- a/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/SpeciesConverter.java
+++ b/converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/SpeciesConverter.java
@@ -329,17 +329,18 @@ public abstract class SpeciesConverter<T extends Species> extends ElementConvert
     graphics.setColor(c);
     graphics.draw(ellipse);
     if (!state.getValue().equals("")) {
-      Font font = new Font(Font.SANS_SERIF, 0, state.getHeight().intValue());
+      Font tmpFont = graphics.getFont();
+      Font font = new Font(Font.SANS_SERIF, 0, state.getFontSize().intValue());
       graphics.setFont(font);
 
       width = graphics.getFontMetrics().stringWidth(state.getValue());
       height = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
 
       double x = state.getPosition().getX() + (state.getWidth() - width) / 2;
-      double y = state.getPosition().getY() + (state.getHeight() - height) / 2;
+      double y = state.getPosition().getY() + (state.getHeight() + height) / 2;
 
       graphics.drawString(state.getValue(), (int) x, (int) y);
-      graphics.setFont(font);
+      graphics.setFont(tmpFont);
     }
 
   }
-- 
GitLab