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

The Screen implementation violates the Liskov Substitution Principle #323

Open
adam-arold opened this issue Aug 14, 2020 · 2 comments
Open
Labels
blocked Tasks which are blocked bug Bugs within the program help wanted More complex issues for which we'd like to get community help

Comments

@adam-arold
Copy link
Member

If a Screen instance is passed to a View's constructor it won't be displayed correctly because the underlying Screen implementation doesn't handle delegation to its underlying TileGrid properly. The display will be garbled.

@adam-arold adam-arold added bug Bugs within the program help wanted More complex issues for which we'd like to get community help labels Aug 14, 2020
@adam-arold adam-arold added this to the 2020.2.0-RELEASE milestone Aug 14, 2020
@Seveen
Copy link
Member

Seveen commented Oct 4, 2020

I've noticed that we're creating a new Screen for the TileGrid in BaseView:
final override val screen = Screen.create(tileGrid)

Testing for the type of TileGrid passed to the View fixes the bug:

final override val screen =
            if (tileGrid is Screen) {
                tileGrid
            } else {
                Screen.create(tileGrid)
            }

but I'm not sure if I'm not simply masking an underlying problem in the Screen implementation

@adam-arold
Copy link
Member Author

I think this is masking, because outside of these Views the problem still persists. I'm not sure that there is a simple solution for this problem unfortunately. 😢

@adam-arold adam-arold removed this from the 2020.2.0-RELEASE milestone Nov 8, 2020
@adam-arold adam-arold added the blocked Tasks which are blocked label Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Tasks which are blocked bug Bugs within the program help wanted More complex issues for which we'd like to get community help
Projects
None yet
Development

No branches or pull requests

2 participants