Attemp at scaling the spacing between lines to better fill the text box;

Did some profiling, conclusions:
 - we want to buffer our input streams, apperantly wx doesn't do this automatically
 - compiling regexes is SLOW.
   This is not just in the numbers, but it is actually noticable! The textbox used to be quite unresponsive.
   I wrapped the call to filter_text in the game file with a quick contains() call, so usually, the regex doesn't fire.
   It would be nicer if this was somehow automatic, but that will not be easy.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@627 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-08-25 00:02:33 +00:00
parent ca55a4d5da
commit 694566fef4
6 changed files with 102 additions and 31 deletions
+6
View File
@@ -52,6 +52,9 @@ TextStyle::TextStyle(const TextFieldP& field)
, line_height_soft(1.0)
, line_height_hard(1.0)
, line_height_line(1.0)
, line_height_soft_max(0.0)
, line_height_hard_max(0.0)
, line_height_line_max(0.0)
, direction(LEFT_TO_RIGHT)
{}
@@ -108,6 +111,9 @@ IMPLEMENT_REFLECTION(TextStyle) {
REFLECT(line_height_soft);
REFLECT(line_height_hard);
REFLECT(line_height_line);
REFLECT(line_height_soft_max);
REFLECT(line_height_hard_max);
REFLECT(line_height_line_max);
REFLECT_N("mask", mask_filename);
REFLECT(direction);
reflect_content(tag, *this);
+3
View File
@@ -65,6 +65,9 @@ class TextStyle : public Style {
double line_height_soft; ///< Line height for soft linebreaks
double line_height_hard; ///< Line height for hard linebreaks
double line_height_line; ///< Line height for <line> tags
double line_height_soft_max; ///< Maximum line height
double line_height_hard_max; ///< Maximum line height
double line_height_line_max; ///< Maximum line height
String mask_filename; ///< Filename of the mask
ContourMask mask; ///< Mask to fit the text to (may be null)
Direction direction; ///< In what direction is text layed out?