问题
With https://github.com/lavrton/react-konva
How can I flip an image (horizontally or vertically) I am using this function, but it is not working:
flip = direction => {
this.setState({
width: -this.state.width
})
}
回答1:
It is better to use scale property:
<Image image={this.state.image} scaleY={-1} y={200}/>
So in your state, you should store scale
property with 1 or -1 values,
https://codesandbox.io/s/v6yk2j2w0l
来源:https://stackoverflow.com/questions/50690175/flip-image-with-react-konva