更改 font-size 后 selection-box 出现问题(fabrics.js,文本)
Issue with selection-box after changing font-size (fabrics.js, Text)
我在我的织物中遇到了一个恼人的错误。js-editor:
更改 font-size 后 selection-box 以及边界区域(您需要单击以 select 对象的区域)在错误的位置=40=]。 (参见图片 1 和 2)
object-selection之前:
object-selection 之后:
如果有人知道如何解决这个问题,我将非常高兴。
谢谢!
canvas.on("object:selected", function(options) {
document.getElementById("setFontSize").onclick = function handleFontSizeEdit() {
canvas.getActiveObject().set("fontSize", document.getElementById("fontSize").value);
canvas.renderAll();
}
Font-Size:
<input type="text" id="fontSize">
<input type="submit" id="setFontSize" value="Set">
已解决
我刚刚意识到我使用的是旧版本的 fabric.js (1.1.0),在将其更改为当前版本 (1.5) 后,选择框的问题消失了。
In case someone wants to see the code:
我在我的织物中遇到了一个恼人的错误。js-editor:
更改 font-size 后 selection-box 以及边界区域(您需要单击以 select 对象的区域)在错误的位置=40=]。 (参见图片 1 和 2)
object-selection之前:
object-selection 之后:
如果有人知道如何解决这个问题,我将非常高兴。 谢谢!
canvas.on("object:selected", function(options) {
document.getElementById("setFontSize").onclick = function handleFontSizeEdit() {
canvas.getActiveObject().set("fontSize", document.getElementById("fontSize").value);
canvas.renderAll();
}
Font-Size:
<input type="text" id="fontSize">
<input type="submit" id="setFontSize" value="Set">
已解决
我刚刚意识到我使用的是旧版本的 fabric.js (1.1.0),在将其更改为当前版本 (1.5) 后,选择框的问题消失了。
In case someone wants to see the code: