Comments (2)
from suika.
你的这个想法只对 不旋转的有填充色的矩形 的特殊情况有效,出现的情况较少,因为绘制大量相同的矩形在一个位置上,挺奇怪的。如果这么做了,更正确的做法是让设计师去优化设计稿。
可以做,但实现上不会简单,做的优先级很低。
目前本项目的 首要目标是架构和功能的实现和完善,渲染引擎优化的优先级不高。渲染引擎优化要做的话,也会优先实现 替换为 WebGL 提高渲染效率、使用脏矩形减少需要重绘的图形、使用 R 树减少遍历等这些更宽泛、性价比更高的实现上。
当然,如果你可以实现这个功能,并提 pr 的话,也很欢迎。
然后是简单谈谈为什么说这是特例。
判断一个元素是否覆盖了另一个元素,并不是这么简单的事情。
假设图形都是矩形,需要考虑的一些情况:
- 矩形发生了旋转,它的包围盒就不是填充满的,是有漏出一些空间的;
- 矩形只有描边、没有填充色;
- 矩形是半透明的;
然后其实编辑器还要支持其他图形,比如椭圆、三阶贝塞尔曲线,它们更特殊,你的想法无法给这些情况提供帮助。
from suika.
Related Issues (20)
- Support drag canvas by mouse wheel
- Refactor graph info panel
- 框选判断碰撞检测逻辑BUG HOT 2
- width height tooltip with selected box
- Support resize mulit graphs
- Support select graphs when draw selection
- Line control handle
- Support import/export
- Support Select All (hotkey: Cmd + A)
- Support stroke attribute
- enhance layer panel
- Support set background color HOT 1
- Support Group
- Support change object name
- lock / unlock
- lock/unlock hot key and contextmenu
- refactor transform handle class
- Support resize graph with north/south/west/east
- Support custom control handle
- 寻求课程合作 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from suika.