Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 685 Bytes

Objects_Snapping.md

File metadata and controls

19 lines (11 loc) · 685 Bytes

title: How to snap shapes positions on dragging with Konva? layout: demo_page


How to snap draggable shapes to each other?

This demo will demonstrate how to implement snapping of objects to all edges of the stage on to all edges of other objects.

Also I found another related demos on the internet that may be useful:

  1. Post: https://medium.com/@pierrebleroux/snap-to-grid-with-konvajs-c41eae97c13f
  2. Demo:https://codepen.io/pierrebleroux/pen/gGpvxJ

Instruction: try to drag and object. See how it snaps to other objects.

{% iframe /downloads/code/sandbox/Objects_Snapping.html %}

{% include_code Konva Custom Font sandbox/Objects_Snapping.html %}