Merge pull request #101 from chaoXxxxx/master

feat: 支持元素多动画,动画启动方式,延迟,退场动画
This commit is contained in:
LLzzZZ 2022-05-13 21:49:43 +08:00 committed by GitHub
commit 1fd36967df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,7 +219,7 @@ export default defineComponent({
colorBlockRef.style.cssText = 'position: absolute; top: -100px; left: -100px; width: 16px; height: 16px; border: 1px solid #000; z-index: 999'
maskRef.appendChild(colorBlockRef)
const { left, top } = targetRef.getBoundingClientRect()
const { left, top, width, height } = targetRef.getBoundingClientRect()
const filter = (node: HTMLElement) => {
if (node.tagName && node.tagName.toUpperCase() === 'FOREIGNOBJECT') return false
@ -227,7 +227,7 @@ export default defineComponent({
return true
}
toCanvas(targetRef, { filter, fontEmbedCSS: '' }).then(canvasRef => {
toCanvas(targetRef, { filter, fontEmbedCSS: '', width, height, canvasWidth: width, canvasHeight: height, pixelRatio: 1 }).then(canvasRef => {
canvasRef.style.cssText = `position: absolute; top: ${top}px; left: ${left}px; cursor: crosshair;`
maskRef.style.cursor = 'default'
maskRef.appendChild(canvasRef)