Giter Club home page Giter Club logo

Comments (2)

Nan-Ling avatar Nan-Ling commented on May 31, 2024

测试用例
image

from suika.

F-star avatar F-star commented on May 31, 2024

你的这个想法只对 不旋转的有填充色的矩形 的特殊情况有效,出现的情况较少,因为绘制大量相同的矩形在一个位置上,挺奇怪的。如果这么做了,更正确的做法是让设计师去优化设计稿。

可以做,但实现上不会简单,做的优先级很低。
目前本项目的 首要目标是架构和功能的实现和完善,渲染引擎优化的优先级不高。渲染引擎优化要做的话,也会优先实现 替换为 WebGL 提高渲染效率、使用脏矩形减少需要重绘的图形、使用 R 树减少遍历等这些更宽泛、性价比更高的实现上。

当然,如果你可以实现这个功能,并提 pr 的话,也很欢迎。

然后是简单谈谈为什么说这是特例。

判断一个元素是否覆盖了另一个元素,并不是这么简单的事情。
假设图形都是矩形,需要考虑的一些情况:

  1. 矩形发生了旋转,它的包围盒就不是填充满的,是有漏出一些空间的;
  2. 矩形只有描边、没有填充色;
  3. 矩形是半透明的;

然后其实编辑器还要支持其他图形,比如椭圆、三阶贝塞尔曲线,它们更特殊,你的想法无法给这些情况提供帮助。

from suika.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.