remove wrapper function

This commit is contained in:
DeaTh-G 2025-01-25 17:30:24 +01:00
parent 191515d32b
commit 3460d887d1
3 changed files with 5 additions and 9 deletions

View file

@ -617,11 +617,6 @@ void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, c
}
}
void DrawCentredParagraph(const ImFont* font, float fontSize, float maxWidth, const ImVec2& centre, float lineMargin, const char* text, std::function<void(const char*, ImVec2)> drawMethod)
{
DrawRubyAnnotatedText(font, fontSize, maxWidth, centre, lineMargin, text, drawMethod, annotationDrawMethod, true);
}
float Lerp(float a, float b, float t)
{
return a + (b - a) * t;

View file

@ -26,7 +26,7 @@ struct TextSegment {
};
struct Paragraph {
bool annotated;
bool annotated = false;
std::vector<std::vector<TextSegment>> lines;
};
@ -68,7 +68,6 @@ std::string RemoveAnnotationFromParagraphLine(const std::vector<TextSegment>& an
ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float lineMargin, std::vector<std::string> lines);
ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float maxWidth, float lineMargin, const char* text);
void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, const ImVec2& pos, float lineMargin, const char* text, std::function<void(const char*, ImVec2)> drawMethod, std::function<void(const char*, float, ImVec2)> annotationDrawMethod, bool isCentred = false);
void DrawCentredParagraph(const ImFont* font, float fontSize, float maxWidth, const ImVec2& centre, float lineMargin, const char* text, std::function<void(const char*, ImVec2)> drawMethod);
float Lerp(float a, float b, float t);
float Cubic(float a, float b, float t);
float Hermite(float a, float b, float t);

View file

@ -307,7 +307,7 @@ void MessageWindow::Draw()
if (DrawContainer(g_appearTime, centre, { textSize.x / 2 + textMarginX, textSize.y / 2 + textMarginY }, !g_isControlsVisible))
{
DrawCentredParagraph
DrawRubyAnnotatedText
(
g_fntSeurat,
fontSize,
@ -323,7 +323,9 @@ void MessageWindow::Draw()
[=](const char* str, float size, ImVec2 pos)
{
DrawTextWithShadow(g_fntSeurat, size, pos, IM_COL32(255, 255, 255, 255), str);
}
},
true
);
drawList->PopClipRect();