feat: outer drag 、fix new page selection

This commit is contained in:
SaikaSakura
2022-08-05 19:29:26 +08:00
parent 812af254aa
commit 5c51457761
16 changed files with 358 additions and 72 deletions

View File

@@ -121,20 +121,20 @@ export class Rect {
}
}
isPointDown({ y }: Point) {
return this.bottom < y;
isPointDown({ x, y }: Point) {
return this.bottom < y && this.left <= x && this.right >= x;
}
isPointUp({ y }: Point) {
return y < this.top;
isPointUp({ x, y }: Point) {
return y < this.top && this.left <= x && this.right >= x;
}
isPointLeft({ x }: Point) {
return x < this.left;
isPointLeft({ x, y }: Point) {
return x < this.left && this.top <= y && this.bottom >= y;
}
isPointRight({ x }: Point) {
return x > this.right;
isPointRight({ x, y }: Point) {
return x > this.right && this.top <= y && this.bottom >= y;
}
fromNewLeft(left: number) {