hrsass-components 2.4.5 → 2.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,7 @@ var contentStyle = _interopDefault(require('!!raw-loader!tinymce/skins/content/d
65
65
  var SvgPanZoom = _interopDefault(require('svg-pan-zoom'));
66
66
  var saveSvgAsPng = require('save-svg-as-png');
67
67
 
68
- var version = "2.4.5";
68
+ var version = "2.4.6";
69
69
 
70
70
  /**
71
71
  * 版本号
@@ -12059,22 +12059,16 @@ var index$6 = {
12059
12059
  // 计算导出图片的 scale
12060
12060
  calcExportScale: function calcExportScale(svgWidth, svgHeight) {
12061
12061
  var realZoom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
12062
- // 屏幕宽高
12063
- var screenW = window.screen.width;
12064
- var screenH = window.screen.height;
12065
- // 目标导出宽度为屏幕宽度的3倍,最高不超过4倍
12066
- var targetW = screenW * 4;
12067
- var scale = targetW / svgWidth;
12068
- // 如果svg很高,按高度再限制一次
12069
- if (svgHeight * scale > screenH * 4.5) {
12070
- scale = screenH * 4.5 / svgHeight;
12071
- if (scale < 1) scale = 1;
12072
- }
12073
- // 限制scale范围,防止过大或过小
12074
- // if (scale < 1) scale = 1;
12075
- // if (scale > 10) scale = 10;
12076
- // 叠加当前svgPanZoom缩放
12077
- scale = scale / realZoom;
12062
+ // 导出图片的宽
12063
+ var exportW = 4800;
12064
+ // svg原始宽
12065
+ var svgW = svgWidth / realZoom;
12066
+ if (svgW > exportW) {
12067
+ exportW = svgW;
12068
+ }
12069
+
12070
+ // 计算scale
12071
+ var scale = exportW / svgW / realZoom;
12078
12072
  return scale;
12079
12073
  },
12080
12074
  // 导出图片