pencil-js/pencil.js

Unexpected clip option behavior

GMartigny opened this issue · 1 comments

The component position of a clip option is relative to the component having the clip. If A is a component that use clip with B as a value, then B's position is relative to A.
This makes sense most of the time when B is not part of the scene and act as a hidden mask.
However, when trying to use another shape in the scene as clip, the difference in position referential could surprise the user.
Especially when trying to clip inside the parent component. The position of the parent is sure to change when relative to the child. We could add a keyword value to clip that means "clip to parent with absolute position", but this would only work with direct parenthood.
We could add an options akin to the CSS overflow rule, but this would need to be applied to all children regardless of depth. This could induce complexity in the code and lower performance.

Close in favor of #86