From db676ef698d299ae757d2c405d25b6eba8872d53 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Fri, 15 Nov 2019 07:25:19 +0200 Subject: [PATCH] Fix hover info text size to be readable with all display zoom settings gitlab #44 Change-Id: I004a69571a10f9313dc7244c43f1906dc7d6aabc (cherry picked from commit 7269f2d5d32c2af2ab97c9124e42bfef37b57109) --- org.simantics.district.imports/.project | 6 ------ .../network/ui/nodes/DistrictNetworkHoverInfoNode.java | 9 ++------- org.simantics.district.repository/.project | 6 ------ 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/org.simantics.district.imports/.project b/org.simantics.district.imports/.project index aebad524..a01e1aeb 100644 --- a/org.simantics.district.imports/.project +++ b/org.simantics.district.imports/.project @@ -20,14 +20,8 @@ - - org.eclipse.m2e.core.maven2Builder - - - - org.eclipse.m2e.core.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkHoverInfoNode.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkHoverInfoNode.java index 24b7f589..f263dc22 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkHoverInfoNode.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkHoverInfoNode.java @@ -14,7 +14,6 @@ import java.util.concurrent.atomic.AtomicReference; 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; @@ -38,10 +37,7 @@ public class DistrictNetworkHoverInfoNode extends G2DNode implements HoverSensit private List 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; @@ -90,9 +86,8 @@ public class DistrictNetworkHoverInfoNode extends G2DNode implements HoverSensit 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(); diff --git a/org.simantics.district.repository/.project b/org.simantics.district.repository/.project index 40015b9e..6771a961 100644 --- a/org.simantics.district.repository/.project +++ b/org.simantics.district.repository/.project @@ -10,14 +10,8 @@ - - org.eclipse.m2e.core.maven2Builder - - - - org.eclipse.m2e.core.maven2Nature org.eclipse.pde.UpdateSiteNature -- 2.47.1