Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
editor and runtime: fix vector n-slicer hit area
This PR changes the vector slicing world upside-down (or outside in)! (hehe :P) Before this PR, on the editor, when you are trying to alt-select a shape in a vector n-slicer, you have to hover over the original shape's position to get the box to show up. I was trying to fix this when I realized that there are many places where the bounds of the shape is checked. E.g. in the state machine, the bounds of the shape is used to detect hover listeners. There were too many places to audit, so that's when I realized I wanted to deform directly on the path instead of just at the rendering layer in the path composer. Path can be categorized into points path and parametric paths (e.g. rects, ellipses, stars). Points path can be deformed by skin. The skin deformation is at the update level of the points path, before the super's update. So by changing _buildPath directly, the deformation happens after skin, which is the same sequence as what's on master today. As such, there are two places I changed on the editor 1. I moved the deforming logic from path_composer to path directly, to preserve the rendering behavior. 2. I changed hit testing logic, so the bounds are computed correctly on the runtime side, I just had to change 1, since 2 is done on the raw path directly, so it just worked. Demo. Left is the current behavior, note that you have to hover over the original button's bounds to get the leaves to show. The right side is after this PR, right+up for editor, right+down for runtime. ![a4](https://github.com/user-attachments/assets/6128c202-0a2a-491a-875d-cbc4571f2128) Diffs= 8826406ff1 editor and runtime: fix vector n-slicer hit area (#8512) Co-authored-by: Susan Wang <[email protected]>
- Loading branch information