fix: text wrap bug

This commit is contained in:
ShawnPhang 2024-01-31 09:58:25 +08:00
parent a2bf3de99a
commit eb562af409
2 changed files with 4 additions and 9 deletions

View File

@ -1,5 +1,4 @@
**[在线体验网址](https://design.palxp.cn/)** | **[中文文档](https://xp.palxp.cn/)** | **[项目常见问题](https://xp.palxp.cn/#/articles/1689323321667)** | [架构及目录说明](https://xp.palxp.cn/#/articles/1689321259854)
**[在线体验网址](https://design.palxp.cn/)** | **[中文文档](https://xp.palxp.cn/)** | [常见问题](https://xp.palxp.cn/#/articles/1689323321667) | [架构说明](https://xp.palxp.cn/#/articles/1689321259854)
---

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,11 +121,7 @@ export default {
const isDone = font.value === this.loadFontDone
if (font.url && !isDone) {
if (font.id && this.isDraw) {
this.loading = false
return
}
this.loading = true
this.loading = !this.isDraw
const loadFont = new window.FontFace(font.value, `url(${font.url})`)
await loadFont.load()
document.fonts.add(loadFont)