Browse Source

REPORT-46353 jdk8-插入普通文本图标变模糊了

【问题原因】之前的获取系统scale的方法有点问题,如果是jdk8,mac下会获取到1.0,然后图标就没有jdk11下获取成2.0那么清晰
【改动思路】直接判断下是不是retina显示,如果是的,返回2.0的scale;另外发现定义数据连接的svg图片漏传了,也传一下
feature/big-screen
Yvan 4 years ago
parent
commit
281d36524d
  1. 7
      designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java
  2. 11
      designer-base/src/main/resources/com/fr/design/images/m_web/connection_normal.svg

7
designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java

@ -1,5 +1,6 @@
package com.fr.base.svg; package com.fr.base.svg;
import com.bulenkov.iconloader.util.UIUtil;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
@ -77,6 +78,10 @@ public class SystemScaleUtils {
* @return * @return
*/ */
public static float sysScale() { public static float sysScale() {
// 如果检测到是retina,直接返回2
if (UIUtil.isRetina()) {
return 2.0f;
}
float scale = 1.0f; float scale = 1.0f;
// 先判断是否支持高清,不支持代表此时是Windows + jdk8 的设计器,返回的scale值为1.0 // 先判断是否支持高清,不支持代表此时是Windows + jdk8 的设计器,返回的scale值为1.0
if (isJreHiDPIEnabled()) { if (isJreHiDPIEnabled()) {
@ -86,7 +91,7 @@ public class SystemScaleUtils {
// 获取图形配置对象 // 获取图形配置对象
GraphicsConfiguration configuration = graphicsDevice.getDefaultConfiguration(); GraphicsConfiguration configuration = graphicsDevice.getDefaultConfiguration();
if (configuration != null && configuration.getDevice().getType() != GraphicsDevice.TYPE_PRINTER) { if (configuration != null && configuration.getDevice().getType() != GraphicsDevice.TYPE_PRINTER) {
// 获取屏幕缩放率,mac下固定为2,Windows+jdk11则将得到用户设置的dpi值 // 获取屏幕缩放率,Windows+jdk11环境下会得到用户设置的dpi值
scale = (float) configuration.getDefaultTransform().getScaleX(); scale = (float) configuration.getDefaultTransform().getScaleX();
} }
} }

11
designer-base/src/main/resources/com/fr/design/images/m_web/connection_normal.svg

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="13px" viewBox="0 0 14 13" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_定义数据连接_normal备份</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组" transform="translate(-1.000000, -2.000000)" fill="#333334" fill-rule="nonzero">
<g id="Combined-Shape">
<path d="M13.9931545,2 C14.5492199,2 15,2.44371665 15,2.99980749 L15,6.00019251 C15,6.18235446 14.9510312,6.35313811 14.8654084,6.50022573 C14.9510251,6.64542671 15,6.81651267 15,6.99980749 L15,8.323 L13.9999505,7.11184475 L13.9999505,7.11184475 L14,6.99980749 L14,6.99980749 L13.676,6.999 L12.677,6 L13.9814047,6.00000045 C13.9891898,6.00000015 13.9931545,6 13.9931545,6 C13.9949083,6 13.9962286,5.72209937 13.9972169,5.33545502 L13.997985,4.98135981 C13.9981003,4.91922053 13.9982094,4.85584834 13.9983125,4.79173639 L13.9988633,4.40213303 C13.9989441,4.33703474 13.9990197,4.27218304 13.9990902,4.2080711 L14,2.99980749 L14,2.99980749 L2.00684547,3 L2.00684547,3 C2.00509174,3 2.00377141,3.27790063 2.00278313,3.66454498 L2.00201498,4.01864019 C2.00189972,4.08077947 2.00179065,4.14415166 2.00168746,4.20826361 L2.00113666,4.59786697 C2.00105585,4.66296526 2.00098034,4.72781696 2.00090983,4.7919289 L2.00000644,5.98367135 C2.00000205,5.99452107 2,6.00019251 2,6.00019251 L8.635,6 L7.636,6.999 L2.00684547,7 L2.00684547,7 C2.00509174,7 2.00377141,7.27790063 2.00278313,7.66454498 L2.00201498,8.01864019 C2.00189972,8.08077947 2.00179065,8.14415166 2.00168746,8.20826361 L2.00113666,8.59786697 C2.00105585,8.66296526 2.00098034,8.72781696 2.00090983,8.7919289 L2.00000644,9.98367135 C2.00000205,9.99452107 2,10.0001925 2,10.0001925 L5.75694924,10.0007296 C5.72425189,10.333731 5.73933308,10.670427 5.80214822,10.9998606 L2.00684547,11 L2.00684547,11 C2.00509174,11 2.00377141,11.2779006 2.00278313,11.664545 L2.00201498,12.0186402 C2.00189972,12.0807795 2.00179065,12.1441517 2.00168746,12.2082636 L2.00113666,12.597867 C2.00105585,12.6629653 2.00098034,12.727817 2.00090983,12.7919289 L2.00000644,13.9836714 C2.00000205,13.9945211 2,14.0001925 2,14.0001925 L5.121,14 L6.121,15 L2.00684547,15 C1.45078007,15 1,14.5562834 1,14.0001925 L1,10.9998075 C1,10.8176455 1.04896881,10.6468619 1.13459156,10.4997743 C1.04897491,10.3545733 1,10.1834873 1,10.0001925 L1,6.99980749 C1,6.81764554 1.04896881,6.64686189 1.13459156,6.49977427 C1.04897491,6.35457329 1,6.18348733 1,6.00019251 L1,2.99980749 C1,2.44762906 1.44994876,2 2.00684547,2 L13.9931545,2 Z M15,12.363 L15,14.0001925 C15,14.5523709 14.5500512,15 13.9931545,15 L11.974132,15.0005781 C12.3954832,14.8298301 12.7902338,14.5737273 13.131728,14.232233 L13.131728,14.232233 L13.363,14 L13.9814047,14.0000004 C13.9891898,14.0000002 13.9931545,14 13.9931545,14 C13.9948594,14 13.9961547,13.7373643 13.9971335,13.3675055 L15,12.363 Z M11.0104076,6.45405845 L11.7175144,7.16116524 L10.3033009,8.5753788 L12.4246212,10.6966991 L13.8388348,9.28248558 L14.5459415,9.98959236 L13.131728,11.4038059 L13.4852814,11.7573593 L12.0710678,13.1715729 C11.2900192,13.9526215 10.0216881,13.9506203 9.24411633,13.1730485 L8.8890873,12.8180195 L7.47487373,14.232233 L6.76776695,13.5251263 L8.18198052,12.1109127 L7.82695148,11.7558837 C7.04671787,10.9756501 7.04193321,9.7154261 7.82842712,8.92893219 L9.24264069,7.51471863 L9.59619408,7.86827202 L11.0104076,6.45405845 Z M9.24264069,8.92893219 L8.53553391,9.63603897 C8.14170149,10.0298714 8.14220916,10.6569278 8.53405826,11.0487769 L9.95122311,12.4659417 C10.3392305,12.8539491 10.9743965,12.8540307 11.363961,12.4644661 L12.0710678,11.7573593 L9.24264069,8.92893219 Z M4,4 L4,5 L3,5 L3,4 L4,4 Z M6,4 L6,5 L5,5 L5,4 L6,4 Z"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

Loading…
Cancel
Save