Fixes the text box cursor position.

The placement of the cursor sometimes was wrong under Windows. (The bug
could be reproduced under Linux by changing the configuration files.)

The problem was caused by the height of the text box and the permission
to wrap the text on a new line. This caused the cursor position to
return to the beginning of the line.

Fixes bug #17220 using patch #3822.
This commit is contained in:
Mark de Wever 2013-03-31 21:01:28 +02:00
parent eea59abd86
commit 9c80bf64c5
5 changed files with 11 additions and 4 deletions

View file

@ -1,6 +1,9 @@
Version 1.11.2+dev:
* Language and i18n:
* Updated translations: Indonesian, Portuguese, Vietnamese
* User interface:
* Fixed (bug #17220): Cursor in gui2 text box now behaves appropriately after
text box overflow occurs.
* Miscellaneous and bug fixes
* Switched to git version control. Hosting moved to SourceForge
* Improved: Autorevision based revision numbers in CMake.

View file

@ -1109,6 +1109,9 @@
name = "Matthias Schoeck (mattsc)"
comment = "AI improvements"
[/entry]
[entry]
name = "Maxim Biro"
[/entry]
[entry]
name = "Maximilian Lupke (malumalu)"
[/entry]

View file

@ -5,7 +5,8 @@ changelog: https://sourceforge.net/p/wesnoth/code/ci/master/tree/changelog
Version 1.11.2+dev:
* Language and i18n:
* Updated translations: Indonesian, Portuguese, Vietnamese.
* User interface:
* Fixed a bug in the cursor positioning in some text entries.
Version 1.11.2:
* Add-ons client:

View file

@ -176,8 +176,8 @@ protected:
void set_maximum_width(const int width)
{ text_.set_maximum_width(width); }
void set_maximum_height(const int height)
{ text_.set_maximum_height(height); }
void set_maximum_height(const int height, const bool multiline)
{ text_.set_maximum_height(height, multiline); }
void set_ellipse_mode(const PangoEllipsizeMode ellipse_mode)
{ text_.set_ellipse_mode(ellipse_mode); }

View file

@ -120,7 +120,7 @@ void ttext_box::place(const tpoint& origin, const tpoint& size)
tcontrol::place(origin, size);
set_maximum_width(get_text_maximum_width());
set_maximum_height(get_text_maximum_height());
set_maximum_height(get_text_maximum_height(), false);
update_offsets();
}