mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
fix: recover text wrap bug
This commit is contained in:
parent
88bde96ae9
commit
39c74895ef
@ -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,
|
||||
|
@ -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的逻辑
|
||||
// 此前该功能在demo中存在换行bug,实际上是由于抽取字体时忽略了空格导致的
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
this.loading = !this.isDraw
|
||||
const loadFont = new window.FontFace(font.value, `url(${font.url})`)
|
||||
await loadFont.load()
|
||||
|
Loading…
x
Reference in New Issue
Block a user