Skip to content

Commit

Permalink
🎨 改进页签拖拽高亮
Browse files Browse the repository at this point in the history
  • Loading branch information
TCOTC committed Dec 25, 2024
1 parent 2703ffb commit ff52b71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/layout/Wnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ export class Wnd {
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;

if (x < width / 6 || x < width / 3 && (x - width / 6) / y < width / height && (x - width / 6) / (height - y) < width / height) {
if (x < width / 3 && (x - width / 6) / y < width / height && x / (height - y) < 2 * width / height) {
dragElement.setAttribute("style", "height:100%;width:50%;right:50%;bottom:0;left:0;top:0");
} else if (x > width * 5 / 6 || x > width * 2 / 3 && (width * 5 / 6 - x) / y < width / height && (width * 5 / 6 - x) / (height - y) < width / height) {
} else if (x > width * 2 / 3 && (width * 5 / 6 - x) / y < width / height && (width - x) / (height - y) < 2 * width / height) {
dragElement.setAttribute("style", "height:100%;width:50%;right:0;bottom:0;left:50%;top:0");
} else if (y < height / 6) {
dragElement.setAttribute("style", "height:50%;width:100%;right:0;bottom:50%;left:0;top:0");
Expand Down

0 comments on commit ff52b71

Please sign in to comment.