A little bug about EditBox

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Guest

A little bug about EditBox

Post by Guest »

after replacing some marked text, the cursor pos is not correct

Code: Select all

				if (MarkBegin != MarkEnd)
				{
					// replace marked text
					s32 realmbgn = MarkBegin < MarkEnd ? MarkBegin : MarkEnd;
					s32 realmend = MarkBegin < MarkEnd ? MarkEnd : MarkBegin;

					s = Text.subString(0, realmbgn);
					s.append(event.KeyInput.Char);
					s.append( Text.subString(realmend, Text.size()-realmend) );
					Text = s;
					CursorPos = realmbgn;
				}
should be?

Code: Select all

					CursorPos = realmbgn+1;

Post Reply