Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix size of splits not loading properly #2554

Merged
merged 4 commits into from
Apr 17, 2021
Merged

fix size of splits not loading properly #2554

merged 4 commits into from
Apr 17, 2021

Conversation

fourtf
Copy link
Member

@fourtf fourtf commented Mar 21, 2021

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

Temporarily disables layouting while splits are being loaded. Also brings loading splits from O(N²) to O(N) I guess.

@fourtf fourtf mentioned this pull request Mar 21, 2021
1 task
@gempir
Copy link
Contributor

gempir commented Mar 21, 2021

From my testing this is equally effective as my PR without losing any safeties. 👍

@pajlada
Copy link
Member

pajlada commented Mar 21, 2021

Looks to me like the Y-flexing stays stable with this PR, but the X-flexing changes for each time I run the application

No restart
2021-03-21-194638_640x480_scrot

One restart
2021-03-21-194653_640x480_scrot

Two restarts
2021-03-21-194708_640x480_scrot

Three restarts
2021-03-21-194730_640x480_scrot

@pajlada
Copy link
Member

pajlada commented Mar 21, 2021

$ diff 1.json 2.json # diff between original size and one restart
39c39
<         "flexh": 0.5241809672386895,
---
>         "flexh": 0.6878198567041964,
$ diff 1.json 3.json # diff between original size and two restarts
39c39
<         "flexh": 0.5241809672386895,
---
>         "flexh": 0.8150394178289873,
$ diff 1.json 4.json # diff between original size and three restarts
39c39
<         "flexh": 0.5241809672386895,
---
>         "flexh": 0.8980955562980287,
$ diff 1.json 5.json # diff between original size and four restarts
39c39
<         "flexh": 0.5241809672386895,
---
>         "flexh": 0.9463122689667313,
# 1.json
{
  "highlightsEnabled": true,
  "selected": true,
  "splits2": {
    "items": [
      {
        "items": [
          {
            "data": {
              "name": "pajlada",
              "type": "twitch"
            },
            "filters": [],
            "flexh": 1,
            "flexv": 0.6297117516629712,
            "moderationMode": false,
            "type": "split"
          },
          {
            "data": {
              "name": "forsen",
              "type": "twitch"
            },
            "filters": [],
            "flexh": 1,
            "flexv": 1.3702882483370287,
            "moderationMode": false,
            "type": "split"
          }
        ],
        "type": "vertical"
      },
      {
        "data": {
          "name": "forsen",
          "type": "twitch"
        },
        "filters": [],
        "flexh": 0.5241809672386895,
        "flexv": 1,
        "moderationMode": false,
        "type": "split"
      }
    ],
    "type": "horizontal"
  }
}

# 5.json
{
  "highlightsEnabled": true,
  "selected": true,
  "splits2": {
    "items": [
      {
        "items": [
          {
            "data": {
              "name": "pajlada",
              "type": "twitch"
            },
            "filters": [],
            "flexh": 1,
            "flexv": 0.6297117516629712,
            "moderationMode": false,
            "type": "split"
          },
          {
            "data": {
              "name": "forsen",
              "type": "twitch"
            },
            "filters": [],
            "flexh": 1,
            "flexv": 1.3702882483370287,
            "moderationMode": false,
            "type": "split"
          }
        ],
        "type": "vertical"
      },
      {
        "data": {
          "name": "forsen",
          "type": "twitch"
        },
        "filters": [],
        "flexh": 0.9463122689667313,
        "flexv": 1,
        "moderationMode": false,
        "type": "split"
      }
    ],
    "type": "horizontal"
  }
}

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in the same fashion as gempirs PR and works perfectly now - no flex changes over multiple restarts 👌

Will merge in/rebase master onto branch after #2628

@pajlada pajlada force-pushed the fix/size-of-splits branch from bfdf9ab to 5a0b0f2 Compare April 17, 2021 12:57
@pajlada pajlada enabled auto-merge (squash) April 17, 2021 12:57
@pajlada pajlada merged commit 58017a7 into master Apr 17, 2021
@pajlada pajlada deleted the fix/size-of-splits branch April 17, 2021 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants