perfect-gui 3.5.2 → 3.5.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perfect-gui",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "description": "Nice and simple GUI for JavaScript.",
5
5
  "main": "src/index.js",
6
6
  "directories": {
package/src/index.js CHANGED
@@ -72,7 +72,12 @@ export default class GUI {
72
72
  }
73
73
 
74
74
  _styleInstance() {
75
- this.xOffset = this.screenCorner.x == 'left' ? 0 : this.container.clientWidth - this.wrapperWidth;
75
+ if (this.screenCorner.x == 'left') {
76
+ this.xOffset = 0;
77
+ } else {
78
+ this.xOffset = this.container.clientWidth - this.wrapperWidth - this._getScrollbarWidth(this.container);
79
+ }
80
+
76
81
  if (this.instanceId > 0) {
77
82
  let existingDomInstances = this.container.querySelectorAll('.p-gui');
78
83
  for (let i = 0; i < existingDomInstances.length; i++) {
@@ -87,7 +92,12 @@ export default class GUI {
87
92
  }
88
93
  }
89
94
  this.yOffset = 0;
90
- this.position = {prevX:this.xOffset, prevY:this.yOffset, x:this.xOffset, y:this.yOffset};
95
+ this.position = {
96
+ prevX: this.xOffset,
97
+ prevY: this.yOffset,
98
+ x: this.xOffset,
99
+ y: this.yOffset
100
+ };
91
101
 
92
102
  this._addStyles(`#p-gui-${this.instanceId} {
93
103
  width: ${this.wrapperWidth}px;