zmdms-webui 0.0.182 → 1.0.0
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.
|
@@ -11,8 +11,10 @@ function createWatermark(watermarkText, options, container) {
|
|
|
11
11
|
var rotatedWidth = cos * watermarkWidth + sin * watermarkHeight;
|
|
12
12
|
var rotatedHeight = sin * watermarkWidth + cos * watermarkHeight;
|
|
13
13
|
// 计算容器可以容纳多少行和列的水印
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var containerWidth = Math.max(container.offsetWidth || 1200, document.body.clientWidth);
|
|
15
|
+
var containerHeight = Math.max(container.offsetHeight || 1200, document.body.clientHeight);
|
|
16
|
+
var cols = Math.ceil(containerWidth / rotatedWidth);
|
|
17
|
+
var rows = Math.ceil(containerHeight / rotatedHeight);
|
|
16
18
|
// 创建一个水印元素
|
|
17
19
|
var fragment = document.createDocumentFragment();
|
|
18
20
|
// 循环创建和定位水印元素
|