MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / drawTooltip

Method drawTooltip

NeuralNote/Source/Components/NeuralNoteLNF.cpp:65–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void NeuralNoteLNF::drawTooltip(Graphics& g, const String& text, int width, int height)
66{
67 g.setColour(WHITE_SOLID.darker(0.0f));
68 g.fillRoundedRectangle(0.0f, 0.0f, static_cast<float>(width), static_cast<float>(height), 5.0f);
69
70 g.setColour(BLACK);
71 g.setFont(UIDefines::LABEL_FONT());
72
73 auto text_std = text.toStdString();
74 int num_line_breaks = static_cast<int>(std::count(text_std.begin(), text_std.end(), '\n'));
75
76 g.drawFittedText(text, 0, 0, width, height, Justification::centred, num_line_breaks + 1);
77}

Callers

nothing calls this directly

Calls 1

LABEL_FONTFunction · 0.85

Tested by

no test coverage detected