fix: recover text wrap bug

This commit is contained in:
ShawnPhang 2024-02-01 14:37:10 +08:00
parent 88bde96ae9
commit 39c74895ef
2 changed files with 11 additions and 5 deletions

View File

@ -2,8 +2,8 @@
* @Author: ShawnPhang
* @Date: 2022-03-16 09:15:52
* @Description:
* @LastEditors: ShawnPhang
* @LastEditTime: 2022-04-08 17:53:00
* @LastEditors: ShawnPhang <https://m.palxp.cn>
* @LastEditTime: 2024-01-31 15:43:10
-->
<template>
<div ref="qrCodeDom" class="qrcode__wrap"></div>
@ -46,7 +46,7 @@ export default defineComponent({
type: 'canvas' as DrawType, // canvas svg
data: props.value,
image: props.image, // /favicon.svg
margin: 2,
margin: 0,
qrOptions: {
typeNumber: 3 as TypeNumber,
mode: 'Byte' as Mode,

View File

@ -54,7 +54,7 @@
const NAME = 'w-text'
import { mapGetters, mapActions } from 'vuex'
// import { fontWithDraw } from '@/utils/widgets/loadFontRule'
import { fontWithDraw } from '@/utils/widgets/loadFontRule'
import getGradientOrImg from './getGradientOrImg.ts'
export default {
@ -107,7 +107,7 @@ export default {
computed: {
...mapGetters(['dActiveElement']),
isDraw() {
return this.$route.name === 'Draw' // && fontWithDraw
return this.$route.name === 'Draw' && fontWithDraw
},
},
watch: {
@ -121,6 +121,12 @@ export default {
const isDone = font.value === this.loadFontDone
if (font.url && !isDone) {
if (font.id && this.isDraw) {
// url
// demobug
this.loading = false
return
}
this.loading = !this.isDraw
const loadFont = new window.FontFace(font.value, `url(${font.url})`)
await loadFont.load()