mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
fix: TextEditor line numbers were still partially rendered despite mShowLineNumbers being set to false (#1669)
### Problem description
TextEditor line numbers were still partially rendered despite
mShowLineNumbers being set to false
### Implementation description
I wrapped the line no. rendering code in `if (mShowLineNumbers) { ...
}`.
### Screenshots
Before:

After:

This commit is contained in:
@@ -914,10 +914,12 @@ void TextEditor::Render() {
|
||||
}
|
||||
|
||||
// Draw line number (right aligned)
|
||||
snprintf(buf, 16, "%d ", lineNo + 1);
|
||||
if (mShowLineNumbers) {
|
||||
snprintf(buf, 16, "%d ", lineNo + 1);
|
||||
|
||||
auto lineNoWidth = ImGui::GetFont()->CalcTextSizeA(ImGui::GetFontSize(), FLT_MAX, -1.0f, buf, nullptr, nullptr).x;
|
||||
drawList->AddText(ImVec2(lineStartScreenPos.x + mTextStart - lineNoWidth, lineStartScreenPos.y), mPalette[(int)PaletteIndex::LineNumber], buf);
|
||||
auto lineNoWidth = ImGui::GetFont()->CalcTextSizeA(ImGui::GetFontSize(), FLT_MAX, -1.0f, buf, nullptr, nullptr).x;
|
||||
drawList->AddText(ImVec2(lineStartScreenPos.x + mTextStart - lineNoWidth, lineStartScreenPos.y), mPalette[(int)PaletteIndex::LineNumber], buf);
|
||||
}
|
||||
|
||||
// Draw breakpoints
|
||||
if (mBreakpoints.count(lineNo + 1) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user