mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
textbox editable property fix
This commit is contained in:
parent
60cfe8595e
commit
1f3cf5ed53
2 changed files with 17 additions and 2 deletions
|
|
@ -130,7 +130,6 @@ void TextBox::drawBackground(const DrawContext* pctx, Assets*) {
|
|||
/// @brief Insert text at the caret. Also selected text will be erased
|
||||
/// @param text Inserting text
|
||||
void TextBox::paste(const std::wstring& text) {
|
||||
|
||||
eraseSelected();
|
||||
if (caret >= input.length()) {
|
||||
input += text;
|
||||
|
|
@ -203,7 +202,9 @@ void TextBox::setTextOffset(uint x) {
|
|||
}
|
||||
|
||||
void TextBox::typed(unsigned int codepoint) {
|
||||
paste(std::wstring({(wchar_t)codepoint}));
|
||||
if (editable) {
|
||||
paste(std::wstring({(wchar_t)codepoint}));
|
||||
}
|
||||
}
|
||||
|
||||
bool TextBox::validate() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue