Author: mordante
Date: Fri Aug 29 19:19:01 2008
New Revision: 29086
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29086&view=rev
Log:
Load the font info for the text box.
This avoids the cursor to be at the wrong offset it the default isn't
the default font.
Modified:
trunk/src/gui/widgets/text.hpp
trunk/src/gui/widgets/text_box.cpp
Modified: trunk/src/gui/widgets/text.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/text.hpp?rev=29086&r1=29085&r2=29086&view=diff
==============================================================================
--- trunk/src/gui/widgets/text.hpp (original)
+++ trunk/src/gui/widgets/text.hpp Fri Aug 29 19:19:01 2008
@@ -163,6 +163,12 @@
tpoint get_column_line(const tpoint& position) const
{ return text_.get_column_line(position); }
+ void set_font_size(const unsigned font_size)
+ { text_.set_font_size(font_size); }
+
+ void set_font_style(const unsigned font_style)
+ { text_.set_font_style(font_style); }
+
/***** ***** ***** setters / getters for members ***** ****** *****/
size_t get_selection_start() const { return selection_start_; }
Modified: trunk/src/gui/widgets/text_box.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/text_box.cpp?rev=29086&r1=29085&r2=29086&view=diff
==============================================================================
--- trunk/src/gui/widgets/text_box.cpp (original)
+++ trunk/src/gui/widgets/text_box.cpp Fri Aug 29 19:19:01 2008
@@ -305,6 +305,17 @@
void ttext_box::load_config_extra()
{
+ assert(config());
+
+ boost::intrusive_ptr<const ttext_box_definition::tresolution> conf =
+ boost::dynamic_pointer_cast
+ <const ttext_box_definition::tresolution>(config());
+
+ assert(conf);
+
+ set_font_size(conf->text_font_size);
+ set_font_style(conf->text_font_style);
+
update_offsets();
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits