sunrize 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sunrize",
3
3
  "productName": "Sunrize X3D Editor",
4
- "version": "1.6.1",
4
+ "version": "1.6.2",
5
5
  "description": "A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -132,7 +132,7 @@ module .exports = new class Panel extends Interface
132
132
  // Move panel in view if top, left, bottom or right is outside of window.
133
133
 
134
134
  const
135
- offset = this .container .offset (),
135
+ offset = this .container .parent () .offset (),
136
136
  width = this .container .width (),
137
137
  height = this .container .height (),
138
138
  body = $("body");
@@ -141,17 +141,21 @@ module .exports = new class Panel extends Interface
141
141
  right = parseFloat (this .container .css ("right")) || 0,
142
142
  bottom = parseFloat (this .container .css ("bottom")) || 0;
143
143
 
144
- if (offset .left + width > body .width ())
145
- right += (offset .left + width) - body .width () + 8;
144
+ const
145
+ left = this .container .parent () .width () - right - width + offset .left,
146
+ top = this .container .parent () .height () - bottom - height + offset .top;
147
+
148
+ if (left + width > body .width ())
149
+ right += (left + width) - body .width () + 8;
146
150
 
147
- if (offset .left < 0)
148
- right += offset .left - 8;
151
+ if (left < 0)
152
+ right += left - 8;
149
153
 
150
- if (offset .top + height > body .height ())
151
- bottom += (offset .top + height) - body .height () + 8;
154
+ if (top + height > body .height ())
155
+ bottom += (top + height) - body .height () + 8;
152
156
 
153
- if (offset .top < 0)
154
- bottom += offset .top - 8;
157
+ if (top < 0)
158
+ bottom += top - 8;
155
159
 
156
160
  this .container .css ({
157
161
  "right": `${right}px`,