修复当思维导图实际内容大于屏幕宽高时,导出的时候超出的部分没有绘制水印的问题
This commit is contained in:
parent
f184a5d948
commit
64228c02ff
@ -344,7 +344,17 @@ class MindMap {
|
|||||||
// 把实际内容变换
|
// 把实际内容变换
|
||||||
draw.translate(-rect.x + elRect.left, -rect.y + elRect.top)
|
draw.translate(-rect.x + elRect.left, -rect.y + elRect.top)
|
||||||
// 克隆一份数据
|
// 克隆一份数据
|
||||||
const clone = svg.clone()
|
let clone = svg.clone()
|
||||||
|
// 如果实际图形宽高超出了屏幕宽高,且存在水印的话需要重新绘制水印,否则会出现超出部分没有水印的问题
|
||||||
|
if ((rect.width > origWidth || rect.height > origHeight) && this.watermark && this.watermark.hasWatermark()) {
|
||||||
|
this.width = rect.width
|
||||||
|
this.height = rect.height
|
||||||
|
this.watermark.draw()
|
||||||
|
clone = svg.clone()
|
||||||
|
this.width = origWidth
|
||||||
|
this.height = origHeight
|
||||||
|
this.watermark.draw()
|
||||||
|
}
|
||||||
// 恢复原先的大小和变换信息
|
// 恢复原先的大小和变换信息
|
||||||
svg.size(origWidth, origHeight)
|
svg.size(origWidth, origHeight)
|
||||||
draw.transform(origTransform)
|
draw.transform(origTransform)
|
||||||
|
|||||||
@ -20,6 +20,11 @@ class Watermark {
|
|||||||
this.updateWatermark(this.mindMap.opt.watermarkConfig || {})
|
this.updateWatermark(this.mindMap.opt.watermarkConfig || {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取是否存在水印
|
||||||
|
hasWatermark() {
|
||||||
|
return !!this.text.trim()
|
||||||
|
}
|
||||||
|
|
||||||
// 处理水印配置
|
// 处理水印配置
|
||||||
handleConfig({ text, lineSpacing, textSpacing, angle, textStyle }) {
|
handleConfig({ text, lineSpacing, textSpacing, angle, textStyle }) {
|
||||||
this.text = text === undefined ? '' : String(text).trim()
|
this.text = text === undefined ? '' : String(text).trim()
|
||||||
@ -36,7 +41,7 @@ class Watermark {
|
|||||||
// 非精确绘制,会绘制一些超出可视区域的水印
|
// 非精确绘制,会绘制一些超出可视区域的水印
|
||||||
draw() {
|
draw() {
|
||||||
this.watermarkDraw.clear()
|
this.watermarkDraw.clear()
|
||||||
if (!this.text.trim()) {
|
if (!this.hasWatermark()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let x = 0
|
let x = 0
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## 0.3.2
|
## 0.3.2
|
||||||
|
|
||||||
Fix: 1.Fix the problem that the node style is not updated when the secondary node is dragged to other nodes or other nodes are dragged to the secondary node;
|
Fix: 1.Fix the problem that the node style is not updated when the secondary node is dragged to other nodes or other nodes are dragged to the secondary node; 2.Fix the problem that when the actual content of the mind map is larger than the screen width and height, the excess part is not watermarked when exporting.
|
||||||
|
|
||||||
## 0.3.1
|
## 0.3.1
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<h1>Changelog</h1>
|
<h1>Changelog</h1>
|
||||||
<h2>0.3.2</h2>
|
<h2>0.3.2</h2>
|
||||||
<p>Fix: 1.Fix the problem that the node style is not updated when the secondary node is dragged to other nodes or other nodes are dragged to the secondary node;</p>
|
<p>Fix: 1.Fix the problem that the node style is not updated when the secondary node is dragged to other nodes or other nodes are dragged to the secondary node; 2.Fix the problem that when the actual content of the mind map is larger than the screen width and height, the excess part is not watermarked when exporting.</p>
|
||||||
<h2>0.3.1</h2>
|
<h2>0.3.1</h2>
|
||||||
<p>Fix: 1.The problem that deleting the background image does not take effect; 2.The problem that the connector runs above the root node when the node is dragged to the root node.</p>
|
<p>Fix: 1.The problem that deleting the background image does not take effect; 2.The problem that the connector runs above the root node when the node is dragged to the root node.</p>
|
||||||
<p>New: Add position and size settings for background image display. This setting is also supported for exported pictures.</p>
|
<p>New: Add position and size settings for background image display. This setting is also supported for exported pictures.</p>
|
||||||
|
|||||||
@ -41,4 +41,10 @@ mindMap.watermark.updateWatermark({
|
|||||||
fontSize: 20
|
fontSize: 20
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### hasWatermark()
|
||||||
|
|
||||||
|
> v0.3.2+
|
||||||
|
|
||||||
|
Gets whether the watermark exists.
|
||||||
@ -31,6 +31,11 @@ MindMap.usePlugin(Watermark)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
<h3>hasWatermark()</h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>v0.3.2+</p>
|
||||||
|
</blockquote>
|
||||||
|
<p>Gets whether the watermark exists.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## 0.3.2
|
## 0.3.2
|
||||||
|
|
||||||
修复:1.修复二级节点拖拽到其他节点或其他节点拖拽到二级节点时节点样式没有更新的问题;
|
修复:1.修复二级节点拖拽到其他节点或其他节点拖拽到二级节点时节点样式没有更新的问题;2.修复当思维导图实际内容大于屏幕宽高时,导出的时候超出的部分没有绘制水印的问题。
|
||||||
|
|
||||||
## 0.3.1
|
## 0.3.1
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<h1>Changelog</h1>
|
<h1>Changelog</h1>
|
||||||
<h2>0.3.2</h2>
|
<h2>0.3.2</h2>
|
||||||
<p>修复:1.修复二级节点拖拽到其他节点或其他节点拖拽到二级节点时节点样式没有更新的问题;</p>
|
<p>修复:1.修复二级节点拖拽到其他节点或其他节点拖拽到二级节点时节点样式没有更新的问题;2.修复当思维导图实际内容大于屏幕宽高时,导出的时候超出的部分没有绘制水印的问题。</p>
|
||||||
<h2>0.3.1</h2>
|
<h2>0.3.1</h2>
|
||||||
<p>修复:1.删除背景图片不生效的问题;2.节点拖拽到根节点时连接线跑到根节点上方的问题。</p>
|
<p>修复:1.删除背景图片不生效的问题;2.节点拖拽到根节点时连接线跑到根节点上方的问题。</p>
|
||||||
<p>新增:背景图片展示增加位置和大小设置。导出的图片也同步支持该设置。</p>
|
<p>新增:背景图片展示增加位置和大小设置。导出的图片也同步支持该设置。</p>
|
||||||
|
|||||||
@ -41,4 +41,10 @@ mindMap.watermark.updateWatermark({
|
|||||||
fontSize: 20
|
fontSize: 20
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### hasWatermark()
|
||||||
|
|
||||||
|
> v0.3.2+
|
||||||
|
|
||||||
|
获取是否存在水印。
|
||||||
@ -31,6 +31,11 @@ MindMap.usePlugin(Watermark)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
<h3>hasWatermark()</h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>v0.3.2+</p>
|
||||||
|
</blockquote>
|
||||||
|
<p>获取是否存在水印。</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user