We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
大佬你好,当一个文本框拖拽的时候,里面的文本也会一起发生大小的变化,但是右侧的文本框却无法变化 这个有办法解嘛? 跟其他同类产品一样文本框拖拽可以使得他的字体大小变化,字体大小变化也可以影响文本框大小变化
The text was updated successfully, but these errors were encountered:
拖拽时是改变的是scaleX和scaleY, fontSize不变。 可以监听object:modified事件,将文本的scaleX和scaleY设回1,fontSize *= scaleX
const updateTextSize = (obj) => { // obj.target.type.indexOf('text')!=-1 if (obj && obj.action == 'scale' && obj.target && obj.target.type == 'i-text') { let textObj = obj.target if (textObj.scaleX != 1 || textObj.scaleY != 1) { let scale = Math.max(textObj.scaleX, textObj.scaleY) textObj.set({ fontSize: Math.floor(textObj.fontSize * scale), scaleX: 1, scaleY: 1, }); canvasEditor.canvas.fire("object:modified", textObj) } } }; canvasEditor.canvas.on('object:modified', updateTextSize);
Sorry, something went wrong.
No branches or pull requests
大佬你好,当一个文本框拖拽的时候,里面的文本也会一起发生大小的变化,但是右侧的文本框却无法变化
这个有办法解嘛? 跟其他同类产品一样文本框拖拽可以使得他的字体大小变化,字体大小变化也可以影响文本框大小变化
The text was updated successfully, but these errors were encountered: