re-resizable icon indicating copy to clipboard operation
re-resizable copied to clipboard

Direction judgment using bitwise operation

Open FishOrBear opened this issue 6 years ago • 3 comments

Like the following, I think it can be better than using string comparison performance.

export enum Direction {
    left = 1,
    right = 2,
    top = 4,
    bottom = 8,
    topLeft = 5,
    topRight = 6,
    bottomLeft = 9,
    bottomRight = 10,
}


if (Direction.top & direction) {

}

FishOrBear avatar Apr 26 '19 06:04 FishOrBear

I modified some code in this repository.

It implements the above features.

At the same time avoid some problems. E.g: Improve the cursor mask, full screen display, (correct display cursor). Improve the range of drag and drop, such as the position in the upper right corner.

https://github.com/FishOrBear/ResizableAndDraggable/blob/master/src/resizable/resizer.tsx#L163

FishOrBear avatar Jul 02 '19 13:07 FishOrBear

hello, how can I get the direction in which it is being resized?

willianmesko avatar Mar 17 '20 15:03 willianmesko

@willianmesko https://github.com/FishOrBear/ResizableAndDraggable/blob/master/src/resizable/resizer.tsx#L203

FishOrBear avatar Mar 18 '20 01:03 FishOrBear