当前位置:网站首页>Fabric.js 激活输入框
Fabric.js 激活输入框
2022-06-09 07:11:00 【InfoQ】
本文简介
HTMLinputinputautofocusJSfocusFabric.jsIText实操
Fabric.jsITextHTMLinput默认情况
Fabric.jsIText
<canvas id="canvasBox" width="600" height="600" style="border: 1px solid #ccc;"></canvas>
<!-- 引入 Fabric.js -->
<script src="https://cdn.bootcdn.net/ajax/libs/fabric.js/521/fabric.js"></script>
<script>
const canvas = new fabric.Canvas('canvasBox')
const iText = new fabric.IText('', {
left: 100, // 输入框离画布左侧距离
top: 100, // 输入框离画布顶部距离
padding: 7 // 设置输入框内边距
})
canvas.add(iText) // 将输入框添加到画布中
</script>
激活输入框

// 省略部分代码
iText.enterEditing()
enterEditing()再进一步
enterEditing()Fabric CanvassetActiveObject()
// 省略部分代码
canvas.add(iText).setActiveObject(iText)
iText.enterEditing()
setActiveObject()总结
Fabric.jsCanvasFabric.jsapi代码仓库
边栏推荐
- MongoDB框架零基础入门(未完)
- 市场变化,欢聚集团如何穿越不确定性风暴?
- Error parsing command line: unrecognized option '--fork' in mongodb
- 2022年全国最新消防设施操作员(中级消防设施操作员)考试模拟题库及答案
- 【踩大坑指南】CSharp_Process_运行之后提示:No Such File或者PyInstaller提示BadZip等
- Technology sharing | discussion on the design of dispatching platform
- 多线程重点知识归纳总结。
- 浅谈数据库优化(以mysql为例)
- Multithreaded concurrency private constructor capture mode
- Clickhouse2 fragment 2 replica high availability cluster setup and chproxy proxy configuration
猜你喜欢

Thread scheduling and thread priority

The sandbox and ikonia have reached a cooperation to restore the murals of the football legend Pirlo in the metauniverse

【踩大坑指南】CSharp_Process_运行之后提示:No Such File或者PyInstaller提示BadZip等

100 code structure and how to avoid them (4)

LVS+keepalived高可用

朴素贝叶斯分类器

PostgreSQL数据库复制——后台一等公民进程WalReceiver 提取信息

Batch writing tidb to improve writing efficiency

常用类——String类概述

openGauss 数据库操作步骤
随机推荐
100 code structure and how to avoid them (4)
实现轮播图就是这么简单!!!
新职业:数字化管理师太抢手,只要来面试,企业就会发offer
New occupation: digital management abbess is in hot demand. As long as she comes for an interview, the enterprise will make an offer
Clickhouse2 fragment 2 replica high availability cluster setup and chproxy proxy configuration
Jump from one pit to another
C# 2~36进制数转化实现
[STL] Introduction to the use of set and map
Thread类的有关方法
推送相关的总结
Mongodb basic understanding
朴素贝叶斯分类器
Idea如何查看保存代码的路径
多线程重点知识归纳总结。
Batch writing tidb to improve writing efficiency
Boot Black apple with OpenCORE
Squid proxy application
UML series articles (26) architecture modeling -- artifacts
287. 寻找重复数
defineProperty