UInt32 TextInputMenu::SeekPosition(UInt32 fromPos, bool bBackwards, bool bSeekWordStart) const { if ((fromPos <= GetMinPos() && bBackwards) || (fromPos > GetMaxPos() && !bBackwards)) return fromPos; //bounds check char curChar = bBackwards ? m_inputText[fromPos - 1] : m_inputText[fromPos]; if (bSeekWordStart || curChar == '<' || curChar == '>') return FindWordBoundary(fromPos, bBackwards); return fromPos + (bBackwards ? -1 : 1); }
Square * Square::GetWordStart(GridDirection dir) { return FindWordBoundary(this, (GridDirection)InvertDirection(dir)); }
Square * Square::GetWordEnd(GridDirection dir) { return FindWordBoundary(this, dir); }
Square * Square::FindWordBoundary(Square * square, GridDirection dir) { return const_cast<Square *>(FindWordBoundary(const_cast<const Square *>(square), dir)); }