msvc having trouble with positive and negative numbers.

This commit is contained in:
paxcut 2025-12-12 07:10:53 -07:00
parent 66077ba74e
commit a0deb66da5
1 changed files with 1 additions and 1 deletions

View File

@ -322,7 +322,7 @@ namespace hex::ui {
}
char Line::operator[](u64 index) const {
i64 signedIndex = std::clamp((i64) index, (i64) -m_chars.size(), (i64) (m_chars.size() - 1));
i64 signedIndex = std::clamp((i64) index,0 - (i64) m_chars.size(), (i64) (m_chars.size() - 1));
if (signedIndex < 0)
return m_chars[m_chars.size() + signedIndex];
return m_chars[signedIndex];