When I drag a stage, stage moves only x-axis.
But konva.js docs doesn't have explanation about it..
Just modify Konva.js sources about drag and i use it?
Or I missed something?
I've found it..
var stage = new Konva.Stage({
container: 'container',
width: window.innerWidth,
height: window.innerHeight,
draggable: true,
dragBoundFunc: (pos) => {
return {
x : pos.x,
y : 0
}
}
});
it's done.
The two drag bounds examples explain how to constrain the movement of a draggable element.
As you have found this approach can be used on the stage.