mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 04:41:39 +00:00
remove empty lines from descriptions without value desc, move fix
This commit is contained in:
parent
b796b59a64
commit
0c721b0b83
2 changed files with 13 additions and 9 deletions
|
|
@ -633,7 +633,13 @@ ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float lineMar
|
||||||
|
|
||||||
ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float maxWidth, float lineMargin, const char* text)
|
ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float maxWidth, float lineMargin, const char* text)
|
||||||
{
|
{
|
||||||
return MeasureCentredParagraph(font, fontSize, lineMargin, Split(text, font, fontSize, maxWidth));
|
const auto input = RemoveRubyAnnotations(text);
|
||||||
|
auto lines = Split(input.first.c_str(), font, fontSize, maxWidth);
|
||||||
|
|
||||||
|
for (auto& line : lines)
|
||||||
|
line = ReAddRubyAnnotations(line, input.second);
|
||||||
|
|
||||||
|
return MeasureCentredParagraph(font, fontSize, lineMargin, lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
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)
|
||||||
|
|
|
||||||
|
|
@ -1373,7 +1373,11 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||||
desc = buf;
|
desc = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
desc += "\n\n" + g_selectedItem->GetValueDescription(Config::Language);
|
const auto& valueDescription = g_selectedItem->GetValueDescription(Config::Language);
|
||||||
|
if (!valueDescription.empty())
|
||||||
|
{
|
||||||
|
desc += "\n\n" + valueDescription;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clipRectMin = { clipRectMin.x, thumbnailMax.y };
|
clipRectMin = { clipRectMin.x, thumbnailMax.y };
|
||||||
|
|
@ -1404,13 +1408,7 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||||
textY += annotationFontSize;
|
textY += annotationFontSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto input = RemoveRubyAnnotations(desc.c_str());
|
auto textSize = MeasureCentredParagraph(g_seuratFont, fontSize, clipRectMax.x - clipRectMin.x, 5.0f, desc.c_str());
|
||||||
auto lines = Split(input.first.c_str(), g_seuratFont, fontSize, clipRectMax.x - clipRectMin.x);
|
|
||||||
|
|
||||||
for (auto& line : lines)
|
|
||||||
line = ReAddRubyAnnotations(line, input.second);
|
|
||||||
|
|
||||||
auto textSize = MeasureCentredParagraph(g_seuratFont, fontSize, 5.0f, lines);
|
|
||||||
|
|
||||||
drawList->PushClipRect(clipRectMin, clipRectMax, false);
|
drawList->PushClipRect(clipRectMin, clipRectMax, false);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue