| 10 | using namespace c2d; |
| 11 | |
| 12 | Highlight::Highlight(const c2d::Vector2f &size, const CursorPosition &pos) : Rectangle(size) { |
| 13 | |
| 14 | gradientRectangle = new GradientRectangle({0, 0, size.x, size.y}); |
| 15 | gradientRectangle->setColor(COLOR_HIGHLIGHT, Color::Transparent, |
| 16 | pos == CursorPosition::Left ? GradientRectangle::Direction::Right |
| 17 | : GradientRectangle::Direction::Left); |
| 18 | Highlight::add(gradientRectangle); |
| 19 | |
| 20 | cursor = new RectangleShape(Vector2f{6, size.y}); |
| 21 | cursor->setFillColor(COLOR_BLUE); |
| 22 | if (pos == CursorPosition::Right) { |
| 23 | cursor->move(size.x - 4, 0); |
| 24 | } |
| 25 | Highlight::add(cursor); |
| 26 | |
| 27 | tween = new TweenPosition(Highlight::getPosition(), |
| 28 | Highlight::getPosition(), (float) INPUT_DELAY / 2); |
| 29 | tween->setState(TweenState::Stopped); |
| 30 | Highlight::add(tween); |
| 31 | } |
| 32 | |
| 33 | void Highlight::setAlpha(uint8_t alpha, bool /*recursive*/) { |
| 34 | if (alpha <= COLOR_HIGHLIGHT.a) { |
nothing calls this directly
no test coverage detected