import java.util.function.ToIntFunction;
import org.simantics.district.network.ui.styles.DistrictNetworkHoverInfoStyle;
-import org.simantics.maps.MapScalingTransform;
import org.simantics.scenegraph.INode;
import org.simantics.scenegraph.NodeException;
import org.simantics.scenegraph.ParentNode;
private List<Tuple3> labels;
- private Font font = new Font(
- Font.SANS_SERIF,
- Font.PLAIN,
- (int)(DPIUtil.upscale(9) * MapScalingTransform.getScaleY() + 0.5));
+ private Font font = new Font(Font.SANS_SERIF, Font.PLAIN, DPIUtil.upscale(14));
@SuppressWarnings("unused")
private Point2D origin;
public void renderDeferred(Graphics2D g) {
if (!hover || activeNode.get() == null)
return;
- if (labels.isEmpty() || mousePosition == null)
+ if (labels == null || labels.isEmpty() || mousePosition == null)
return;
AffineTransform ot = g.getTransform();
Font of = g.getFont();
g.translate(mousePosition.getX(), mousePosition.getY());
//g.translate(origin.getX(), origin.getY());
- double scale = DPIUtil.upscale( 1.25 / GeometryUtils.getScale(g.getTransform()) );
+ double scale = 1.0 / GeometryUtils.getScale(g.getTransform());
g.scale(scale, scale);
-
g.setFont(font);
FontMetrics fm = g.getFontMetrics();