2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 22:27:43 +00:00

Add True and False tests for bitwise enums

This commit is contained in:
Jack Andersen
2019-04-02 18:30:35 -10:00
parent 9bb21b0b32
commit 8ba5cf9a8b
4 changed files with 6 additions and 6 deletions

View File

@@ -320,7 +320,7 @@ void TextField::specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, boo
return;
if (key == boo::ESpecialKey::Left) {
if ((mods & boo::EModifierKey::Shift) != boo::EModifierKey::None) {
if (True(mods & boo::EModifierKey::Shift)) {
if (m_cursorPos) {
size_t origPos = m_cursorPos;
if (m_selectionCount) {
@@ -338,7 +338,7 @@ void TextField::specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, boo
setCursorPos(m_cursorPos == 0 ? 0 : (m_cursorPos - 1));
}
} else if (key == boo::ESpecialKey::Right) {
if ((mods & boo::EModifierKey::Shift) != boo::EModifierKey::None) {
if (True(mods & boo::EModifierKey::Shift)) {
std::string_view textStr(m_textStr);
size_t len = UTF8Iterator(textStr.cbegin()).countTo(textStr.cend());
if (m_cursorPos < len) {