refactor
This commit is contained in:
parent
c83c015357
commit
90a3137ed2
|
@ -91,10 +91,6 @@ function waitForDecode() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => props.src, () => {
|
|
||||||
waitForDecode();
|
|
||||||
});
|
|
||||||
|
|
||||||
watch([() => props.width, () => props.height, root], () => {
|
watch([() => props.width, () => props.height, root], () => {
|
||||||
const ratio = props.width / props.height;
|
const ratio = props.width / props.height;
|
||||||
if (ratio > 1) {
|
if (ratio > 1) {
|
||||||
|
@ -140,6 +136,10 @@ async function draw(transfer: boolean = false) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(() => props.src, () => {
|
||||||
|
waitForDecode();
|
||||||
|
});
|
||||||
|
|
||||||
watch(() => props.hash, () => {
|
watch(() => props.hash, () => {
|
||||||
draw();
|
draw();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue