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 duplicate backgrounds when using horizontal and vertical editor split #69

Merged
merged 4 commits into from
Nov 26, 2022

Conversation

Katsute
Copy link
Member

@Katsute Katsute commented Nov 25, 2022

Prerequisites

Issues must meet the following criteria:

  • No similar pull request exists.
  • Code follows the general code style of this project.
  • No sensitive information is exposed.
  • Relevant comments have been added.

GitHub Copilot Disclaimer

The use of GitHub Copilot is strictly prohibited on this repository.

  • This pull does not use GitHub Copilot.

Changes Made

List any changes made and/or other relevant issues.

Very complicated css logic:

First, handle horizontal splits only:

#workbench\\\\.parts\\\\.editor

:not(.split-view-container) // prevent styling horizontal + vertical combo

.split-view-container > .split-view-view:nth-child(\${len}n+\${j+1})

> .editor-group-container::after

for i = 0; i < len; i++

i 0 1 2 3
0 0 1 2 3

For col i, image index is simply i

Then, handle horizontal and vertical splits:

#workbench\\\\.parts\\\\.editor

.split-view-container > .split-view-view:nth-child(\${len}n+\${i+1})

.split-view-container > .split-view-view:nth-child(\${len}n+\${j+1})

> .editor-group-container::after

for i, j = 0; i, j < len; i, j++

i \ j 0 1 2 3
0 0 1 2 3
1 1 2 3 0
2 2 3 0 1
3 3 0 1 2

For col i, row j, derive image index using (i+j)%len

@Katsute Katsute added the bug label Nov 25, 2022
@Katsute Katsute self-assigned this Nov 25, 2022
@Katsute
Copy link
Member Author

Katsute commented Nov 25, 2022

Uninstall doesn't seem to work properly, possible caused by longer write.

@Katsute Katsute changed the title Fix duplicate backgrounds when using horizontal and vertical editor split at same time Fix duplicate backgrounds when using horizontal and vertical editor split Nov 25, 2022
@Katsute
Copy link
Member Author

Katsute commented Nov 25, 2022

Instead of having a separate css statement for each i, j; add each css selector to an array based on which background image it's for.

Reduces the amount of css background image references from i*j to i. Seems to also fix the uninstall issue since the redundant css has been removed.

@Katsute Katsute marked this pull request as ready for review November 26, 2022 18:04
@Katsute

This comment has been minimized.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

@Katsute I have approved this pull request

@Katsute Katsute merged commit e9249d0 into main Nov 26, 2022
@Katsute Katsute deleted the fix-editor-split@b6777b1 branch November 26, 2022 18:14
@ghost ghost locked and limited conversation to collaborators Nov 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vertical editor split is not randomized
1 participant