Skip to content

Commit

Permalink
don't set labels directly to visible when coming into screen
Browse files Browse the repository at this point in the history
- this caused big label-clouds in tilted views
  • Loading branch information
hjanetzek committed Aug 9, 2016
1 parent 1de1837 commit ba8d269
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions core/src/labels/label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,7 @@ bool Label::update(const glm::mat4& _mvp, const glm::vec2& _screenSize, float _z
return false;
}
} else if (m_state == State::out_of_screen) {
if (m_occludedLastFrame) {
enterState(State::sleep, 0.0);
} else {
// Non-occluded out-of-screen label came into
// screen again. Skip fade-in transition.
enterState(State::visible, 1.0);
}
enterState(State::sleep, 0.0);
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/labelTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ TEST_CASE( "Ensure the out of screen state transition", "[Core][Label]" ) {
l.evalState(0);
REQUIRE(l.state() != Label::State::none);

REQUIRE(l.state() == Label::State::visible);
REQUIRE(l.state() == Label::State::fading_in);
REQUIRE(l.canOcclude());
}

Expand Down

0 comments on commit ba8d269

Please sign in to comment.