我是前端西瓜哥,Web 前端开发,图形编辑器方向。
我的公众号:前端西瓜哥。
如果你是做图形编辑器开发或是感兴趣的,可以加我微信 frstars。
如果想加群,可以备注 “图形群”,我拉你进群。
一款简单的 Web SVG 编辑器。A Simple Web SVG Editor.
Home Page: https://blog.fstars.wang/app/svg-editor/
全局快捷键的画布缩放功能,而不需要切换到 “放大镜” 工具来进行缩放。比如在绘制 path 的过程中,能够边缩放边绘制曲线,无疑用户体验更好。
暂定缩放画布快捷键:Ctrl + 滚轮
或 Command + 滚轮
(MacOS)
待办清单
不考虑历史记录的影响,在钢笔工具的模式下,每次鼠标按下,需要记录
如果使用了 undo,会导致 path 丢掉最后的一段 curve(曲线),导致 this.x 和 this.y 以及 this.prevX, this.prevY 不再正确。
如题,需要设计一套方案来支持实现记录钢笔工具每一步操作,支持撤销和重做,并要考虑性能上的问题、复合贝塞尔问题等情况。
在实现绘制钢笔工具的预测曲线时,需要一个全新的非拖拽状态的移动事件,暂定为方法名为 moveNoPressed,在尝试往 toolManage.ts 文件添加这个功能代码时,发现代码的逻辑已经有些看不懂了,而且貌似也不好加这个新的方法。
于是决定梳理和重构一番。
PathDraw 负责显示绘制曲线的轮廓线,其下关联的 SegDraw 则负责控制下一个 seg 的参数设置(通过交互的方式)。PredictedCurve 则是预测下一段将要绘制的 Curve。因为是先开发 PathDraw 再开发的 PredictedCurve,所以出现了设计不合理的地方,PathDraw 也负责了预测线的部分功能:拖拽鼠标配置 seg 时,替代了 PredictedCurve 绘制出了下一段曲线(作为 PathDraw 绘制的轮廓线的一部分)
遵循单一职责原则,故重新进行代码的设计。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.