We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I click on a blank place it shows beyond the stack
@lavrton
selecting = false; if (!selectionRectangle.visible()) { return; } e.evt.preventDefault(); selectionRectangle.visible(false); const shapes = stage.find('.rects'); const box = selectionRectangle.getClientRect(); const selected = shapes.filter(shape => Konva.Util.haveIntersection(box, shape.getClientRect())); transformer.nodes(selected);
transformer = new Konva.Transformer({ shouldOverdrawWholeArea: true }); stage.add(layer); layer.add(transformer); stage.container().addEventListener('dragover', e => e.preventDefault()); stage.container().addEventListener('drop', onDrop); const { selectionRectangle, startSelection, moveSelection, endSelection } = useSelection({ stage, transformer }); layer.add(selectionRectangle); layer.draw(); stage.on('mousedown touchstart', startSelection); stage.on('mousemove touchmove', moveSelection); stage.on('mouseup touchend', endSelection); // window.addEventListener('keydown', handleKeyDown); stage.on('click tap', e => handleOnClickStage(e, selectionRectangle)); const rect = new Konva.Rect({ x: dropX, y: dropY, width: rectWidth, height: rectHeight, fill: 'red', name: 'rects', draggable: true }); layer.add(rect); layer.draw();
if (selectionRectangle.visible()) { return; } if (e.target === stage) { transformer.nodes([]); return; } const metaPressed = e.evt.shiftKey || e.evt.ctrlKey || e.evt.metaKey; const isSelected = transformer.nodes().includes(e.target); if (!metaPressed && !isSelected) { transformer.nodes([e.target]); } else if (metaPressed && isSelected) { const nodes = transformer.nodes().slice(); nodes.splice(nodes.indexOf(e.target), 1); transformer.nodes(nodes); } else if (metaPressed && !isSelected) { const nodes = transformer.nodes().concat([e.target]); transformer.nodes(nodes); }
The text was updated successfully, but these errors were encountered:
Make a demo. From the video, looks like you added a node into transformer. Like tr.add(node). If so, don't do that.
tr.add(node)
Sorry, something went wrong.
No branches or pull requests
When I click on a blank place it shows beyond the stack
chrome_Sz3HBUTvBv.mp4
@lavrton
The text was updated successfully, but these errors were encountered: