Commit e831de89 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

font size was inproperly taken

parent 10c674f4
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)
......
......@@ -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);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment