Paper boundary with restrictTranslate doesn't work after <path> shape is rotated. #2731
-
IntroductionIf I have paper with a boundary defined by restrictTranslate being set to true, it means my shapes can't go over the boundary, and can be dragged to the edge of the paper as intended. However when I rotate my items using the halo rotate tool, I can't drag the item to the edge of the paper, there is invisible whitespace blocking it. I assume because the bounding box has not been updated. The shape being along the edge: Once rotated, it can no longer be dragged to the edge: Steps to reproduceRestrictions & ConstraintsI need to be using a custom shape and have a fixed x by x boundary I can drag to the side of. Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS, JointJS+ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It works as intended. We take only the rotated model bounding box into account which is always a rectangle. The |
Beta Was this translation helpful? Give feedback.
It works as intended. We take only the rotated model bounding box into account which is always a rectangle.
blue
is the element bounding box andred
is rotated element bounding boxThe
restrictTranslate()
could be defined as a function returning a function, if you need to implement a custom logic.Here's an example: https://www.jointjs.com/demos/hexagonal-grid