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 SpriteText size not being computer when set to empty #1548

Merged
merged 6 commits into from May 10, 2018

Conversation

2 participants
@smoogipoo
Copy link
Contributor

smoogipoo commented May 10, 2018

When a SpriteText's text becomes string.Empty, it will become !IsPresent, and will:

  1. Not clear its children
  2. Not alert parents of this presence change.

This fixes both of those.

@smoogipoo smoogipoo added the bug label May 10, 2018

@smoogipoo smoogipoo added this to the May 2018 milestone May 10, 2018

@peppy peppy added the drawable label May 10, 2018

@smoogipoo smoogipoo referenced this pull request May 10, 2018

Merged

Add keybind to disable mouse buttons #2483

1 of 1 task complete
@@ -38,7 +38,7 @@ public class SpriteText : FillFlowContainer, IHasCurrentValue<string>, IHasLineB
/// </summary>
public bool UseFullGlyphHeight = true;

public override bool IsPresent => base.IsPresent && !string.IsNullOrEmpty(text);
public override bool IsPresent => base.IsPresent && (!layout.IsValid || !string.IsNullOrEmpty(text));

This comment has been minimized.

@peppy

peppy May 10, 2018

Member

nitpick, but i think the empty check should come first as it's the predominant case

@peppy

peppy approved these changes May 10, 2018

@peppy peppy merged commit af03b4a into ppy:master May 10, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@smoogipoo smoogipoo deleted the smoogipoo:spritetext-clear-fix branch Nov 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.