mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 09:17:23 +01:00
15 lines
341 B
C++
15 lines
341 B
C++
#include "text_field_with_extension.h"
|
|
|
|
namespace Shared {
|
|
|
|
void TextFieldWithExtension::willSetCursorLocation(int * location) {
|
|
size_t textLength = strlen(text());
|
|
assert(textLength >= m_extensionLength);
|
|
size_t maxLocation = textLength - m_extensionLength;
|
|
if (*location > (int)maxLocation) {
|
|
*location = maxLocation;
|
|
}
|
|
}
|
|
|
|
}
|