You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi team,
I need to implement a feature that will drop a Stencil element multiple times after it has been selected, so I need to give the selected element a selected state, e.g. change the background colour.
For example, add a red background when selected as shown below. When clicking the selected element again, it needs to deselect, which means removing the background color.
The method I used is to get the coordinates of the clicked element and add a red background <rect fill="red" stroke="red"> at the coordinates. However, this feels a bit messy and will affect other Stencil functionalities, while requiring a lot of conditional checks. I’m not sure if there is a better way?🙏
Steps to reproduce
No response
Restrictions & Constraints
No response
Does your question relate to JointJS or JointJS+. Select both if applicable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Introduction
Hi team,
I need to implement a feature that will drop a Stencil element multiple times after it has been selected, so I need to give the selected element a selected state, e.g. change the background colour.
For example, add a red background when selected as shown below. When clicking the selected element again, it needs to deselect, which means removing the background color.
The method I used is to get the coordinates of the clicked element and add a red background
<rect fill="red" stroke="red">
at the coordinates. However, this feels a bit messy and will affect other Stencil functionalities, while requiring a lot of conditional checks. I’m not sure if there is a better way?🙏Steps to reproduce
No response
Restrictions & Constraints
No response
Does your question relate to JointJS or JointJS+. Select both if applicable.
JointJS+
Beta Was this translation helpful? Give feedback.
All reactions