Vejsil Hrustić
Vejsil Hrustić

Reputation: 179

Prevent shape rotation by dragging in Konva

I'm using react-konva (Konva) and I need to prevent rotating the shape(rectangle) by clicking on corner point and dragging it over diagonal corner point. That will rotate the rectangle by 180 or -180 deg. Setting rotation=0 works only if you do 180deg rotation, otherwise, the shape is misplaced after you finish dragging.

How can I disable shape transformation and not allow dragging any point over another shape's point?

Upvotes: 1

Views: 516

Answers (1)

Vanquished Wombat
Vanquished Wombat

Reputation: 9535

You need to set flipEnabled to false https://konvajs.org/api/Konva.Transformer.html#flipEnabled__anchor. This is stop the effect you are seeing.

Upvotes: 1

Related Questions