UNPKG

react-color-picker

Version:
21 lines (16 loc) 255 B
export default (info) => { const { height, width } = info if (info.x < 0){ info.x = 0 } if (info.x >= width) { info.x = width } if (info.y < 0) { info.y = 0 } if (info.y >= height) { info.y = height } return info }