Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a15fd6d

Browse files
feat: point调整
1 parent adcf420 commit a15fd6d

File tree

2 files changed

+39
-21
lines changed

2 files changed

+39
-21
lines changed

‎src/views/common/drag/components/draggable.module.scss

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,45 @@
1717
border: 3px solid var(--primary-color);
1818
border-radius: 5px;
1919
background-color: #fff;
20-
transform: translate(-50%, -50%);
2120

2221
&.t {
2322
width: 30px;
23+
transform: translate(-50%, -100%);
2424
}
2525

2626
&.b {
2727
width: 30px;
28+
transform: translate(-50%);
2829
}
2930

3031
&.l,
3132
&.r {
3233
height: 30px;
3334
}
3435

35-
&.r {}
36+
&.r {
37+
transform: translate(0%, -50%);
38+
}
39+
40+
&.l {
41+
transform: translate(-100%, -50%);
42+
}
43+
44+
&.rt {
45+
transform: translate(0%, -100%);
46+
}
3647

37-
&.l {}
48+
&.rb {
49+
transform: translate(0%, 0%);
50+
}
3851

39-
&.rt,
40-
&.rb {}
52+
&.lb {
53+
transform: translate(-100%, 0%);
54+
}
55+
56+
&.lt {
57+
transform: translate(-100%, -100%);
58+
}
4159
}
4260

4361
.draggableActiveModal {

‎src/views/common/drag/hooks/useMouse.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ export default function useMouse(
3939
let x = itemAttrX + (isLeft ? currX : 0)
4040
let y = itemAttrY + (isTop ? currY : 0)
4141

42-
if (x > parentWidth - w) {
43-
w = Math.abs(parentWidth - x)
44-
x = parentWidth - w
45-
}
46-
if (x < 0) {
47-
w = w - Math.abs(x)
48-
x = 0
49-
}
50-
if (y > parentHeight - h) {
51-
h = Math.abs(parentHeight - y)
52-
y = parentHeight - h
53-
}
54-
if (y < 0) {
55-
h = h - Math.abs(y)
56-
y = 0
57-
}
42+
// if (x > parentWidth - w) {
43+
// w = Math.abs(parentWidth - x)
44+
// x = parentWidth - w
45+
// }
46+
// if (x < 0) {
47+
// w = w - Math.abs(x)
48+
// x = 0
49+
// }
50+
// if (y > parentHeight - h) {
51+
// h = Math.abs(parentHeight - y)
52+
// y = parentHeight - h
53+
// }
54+
// if (y < 0) {
55+
// h = h - Math.abs(y)
56+
// y = 0
57+
// }
5858

5959
setAttrs({ x, y, w, h })
6060
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /