Skip to content

Adds alternateText to AsciiArtItem #93

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

Merged
merged 2 commits into from
May 2, 2018

Conversation

Lynesth
Copy link
Collaborator

@Lynesth Lynesth commented May 2, 2018

This will replace the AsciiArtItem with a StaticItem if the art is to big to fit in the menu/screen.

The new output will ignore position and be left aligned. Will print an empty line by default.

$asciiArtItem = new AsciiArtItem($art, $position);

if ($asciiArtItem->getArtLength() <= $this->getMenuStyle()->getContentWidth()) {
$this->addMenuItem($asciiArtItem);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it would be cleaner to just add a static item here instead? Then we wouldn't have to modify AsciiArtItem

Copy link
Collaborator Author

@Lynesth Lynesth May 2, 2018

Choose a reason for hiding this comment

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

Then it wouldn't work if you first create the AsciiArtItem and then add it using addMenuItem().

Edit: That's why I went with this method.

Copy link
Member

Choose a reason for hiding this comment

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

Ok makes sense - I begin to think that the CliMenuBuilder was not such a good idea.

@AydinHassan AydinHassan merged commit c799acf into php-school:master May 2, 2018
@AydinHassan AydinHassan added this to the 3.0 milestone May 7, 2018
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.

2 participants