Skip to content

Commit c3cd2b9

Browse files
hansonrhansonr
authored andcommitted
frame movement blocking at window top and left
1 parent 94e5ade commit c3cd2b9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSFrameUI.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import javajs.api.JSFunction;
44

55
import java.awt.Color;
6+
import java.awt.Container;
67
import java.awt.Dimension;
78
import java.awt.Insets;
89
import java.awt.Rectangle;
@@ -137,7 +138,7 @@ public DOMNode updateDOMNode() {
137138
* return $(fnode).parent();
138139
* case 3:
139140
* if (mode == 506) {
140-
* me.moveFrame$I$I(x,y);
141+
* me.moveFrame$I$I(x, y);
141142
* return null;
142143
* }
143144
* }
@@ -179,7 +180,12 @@ public DOMNode updateDOMNode() {
179180
}
180181

181182

183+
182184
void moveFrame(int x, int y) {
185+
if (!isInternalFrame) {
186+
x = Math.max(30 - frame.getWidth(), x);
187+
y = Math.max(0, y);
188+
}
183189
frame.setLocation(x, y);
184190
}
185191

0 commit comments

Comments
 (0)