selecting by drawing a box around objects in konva
Is there an example or way of drawing a box around multiple objects on the konva canvas and by doing so selecting the objects which are inside this box with some kind of indicator around them? Here's a working snippet. Uses simple rect-overlap collision detection and corrects drag rect co-ordinates if user chooses to drag north or east. Should get you going. // Set up the canvas and shapes var s1 = new Konva.Stage({container: 'container1', width: 300, height: 200}); var layer1 = new Konva.Layer({draggable: false}); s1.add(layer1); // draw a background rect to catch events. var r1 = new Konva