添加 cl-watermark 水印组件
This commit is contained in:
@@ -180,12 +180,16 @@ async function drawWatermark() {
|
|||||||
drawCtx.canvas.height = containerHeight.value;
|
drawCtx.canvas.height = containerHeight.value;
|
||||||
|
|
||||||
// 清空画布
|
// 清空画布
|
||||||
|
// #ifdef APP
|
||||||
drawCtx.reset();
|
drawCtx.reset();
|
||||||
|
// #endif
|
||||||
drawCtx.clearRect(0, 0, containerWidth.value, containerHeight.value);
|
drawCtx.clearRect(0, 0, containerWidth.value, containerHeight.value);
|
||||||
|
|
||||||
// 缩放画布以适配高分屏
|
// 缩放画布以适配高分屏
|
||||||
|
// #ifdef APP
|
||||||
const ratio = getDevicePixelRatio();
|
const ratio = getDevicePixelRatio();
|
||||||
drawCtx.scale(ratio, ratio);
|
drawCtx.scale(ratio, ratio);
|
||||||
|
// #endif
|
||||||
|
|
||||||
// 设置全局透明度
|
// 设置全局透明度
|
||||||
drawCtx.globalAlpha = props.opacity;
|
drawCtx.globalAlpha = props.opacity;
|
||||||
|
|||||||
Reference in New Issue
Block a user