Skip to content

Commit 1f53bf3

Browse files
committed
fix split screen minimized positions
1 parent 32945e3 commit 1f53bf3

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

dist/js/winbox.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/winbox.bundle.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "winbox",
3-
"version": "0.2.8",
3+
"version": "0.2.81",
44
"description": "Modern HTML5 window manager for the web.",
55
"homepage": "https://nextapps-de.github.io/winbox/",
66
"author": "Thomas Wilkerling",

src/js/winbox.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ function parse(num, base, center){
341341

342342
if(num === "center"){
343343

344-
num = ((base - center) / 2) | 0;
344+
num = ((base - center) / 2 + 0.5) | 0;
345345
}
346346
else if(num === "right" || num === "bottom"){
347347

@@ -354,7 +354,7 @@ function parse(num, base, center){
354354

355355
if(unit === "%"){
356356

357-
num = (base / 100 * value) | 0;
357+
num = (base / 100 * value + 0.5) | 0;
358358
}
359359
else{
360360

@@ -506,7 +506,7 @@ function update_min_stack(){
506506
for(let i = 0, self, key; i < length; i++){
507507

508508
self = stack_min[i];
509-
key = (self.left || self.right) + ":" + (self.top || self.bottom);
509+
key = self.left + ":" + self.top;
510510

511511
if(splitscreen_length[key]){
512512

@@ -522,9 +522,8 @@ function update_min_stack(){
522522
for(let i = 0, self, key, width; i < length; i++){
523523

524524
self = stack_min[i]
525-
key = (self.left || self.right) + ":" + (self.top || self.bottom);
525+
key = self.left + ":" + self.top;
526526
width = Math.min((root_w - self.left - self.right) / splitscreen_length[key], 250);
527-
//splitscreen_index[key] || (splitscreen_index[key] = 0);
528527
self.resize((width + 1) | 0, self.header, true)
529528
.move((self.left + splitscreen_index[key] * width) | 0, root_h - self.bottom - self.header, true);
530529
splitscreen_index[key]++;

0 commit comments

Comments
 (0)