Browse Source

Remove right-hand spacing from Tooltip.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
80094b0f2e
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/ui/Tooltip.cpp

+ 3
- 3
src/ui/Tooltip.cpp View File

@@ -11,9 +11,9 @@ void Tooltip::step() {
// Wrap size to contents
nvgSave(APP->window->vg);
nvgTextLineHeight(APP->window->vg, 1.2);
box.size.x = bndLabelWidth(APP->window->vg, -1, text.c_str()) + 10.0;
box.size.x = bndLabelWidth(APP->window->vg, -1, text.c_str());
box.size.y = bndLabelHeight(APP->window->vg, -1, text.c_str(), INFINITY);
// Position near cursor. This assumes that `this` is added to the root widget.
// Position near cursor. This assumes that the Tooltip is added to the root widget.
box.pos = APP->scene->mousePos.plus(math::Vec(15, 15));
// Fit inside parent
assert(parent);
@@ -26,7 +26,7 @@ void Tooltip::step() {
void Tooltip::draw(const DrawArgs& args) {
bndTooltipBackground(args.vg, 0.0, 0.0, box.size.x, box.size.y);
nvgTextLineHeight(args.vg, 1.2);
bndMenuLabel(args.vg, 0.0, 0.0, box.size.x, box.size.y, -1, text.c_str());
bndMenuLabel(args.vg, 0.0, 0.0, INFINITY, box.size.y, -1, text.c_str());
Widget::draw(args);
}



Loading…
Cancel
Save