mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
made padding and line height scriptable
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1249 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+16
-1
@@ -70,7 +70,22 @@ int TextStyle::update(Context& ctx) {
|
||||
return Style ::update(ctx)
|
||||
| font .update(ctx) * CHANGE_OTHER
|
||||
| symbol_font.update(ctx) * CHANGE_OTHER
|
||||
| alignment .update(ctx) * CHANGE_OTHER;
|
||||
| alignment .update(ctx) * CHANGE_OTHER
|
||||
| ( padding_left .update(ctx)
|
||||
| padding_left_min .update(ctx)
|
||||
| padding_right .update(ctx)
|
||||
| padding_right_min .update(ctx)
|
||||
| padding_top .update(ctx)
|
||||
| padding_top_min .update(ctx)
|
||||
| padding_bottom .update(ctx)
|
||||
| padding_bottom_min .update(ctx)
|
||||
| line_height_soft .update(ctx)
|
||||
| line_height_hard .update(ctx)
|
||||
| line_height_line .update(ctx)
|
||||
| line_height_soft_max.update(ctx)
|
||||
| line_height_hard_max.update(ctx)
|
||||
| line_height_line_max.update(ctx)
|
||||
) * CHANGE_OTHER;
|
||||
}
|
||||
void TextStyle::initDependencies(Context& ctx, const Dependency& dep) const {
|
||||
Style ::initDependencies(ctx, dep);
|
||||
|
||||
+22
-21
@@ -51,26 +51,27 @@ class TextStyle : public Style {
|
||||
TextStyle(const TextFieldP&);
|
||||
DECLARE_STYLE_TYPE(Text);
|
||||
|
||||
Font font; ///< Font to use for the text
|
||||
SymbolFontRef symbol_font; ///< Symbol font for symbols in the text
|
||||
bool always_symbol; ///< Should everything be drawn as symbols?
|
||||
bool allow_formating; ///< Is formating (bold/italic/..) allowed?
|
||||
Scriptable<Alignment> alignment; ///< Alignment inside the box
|
||||
double padding_left, padding_left_min; ///< Padding
|
||||
double padding_right, padding_right_min; ///< Padding
|
||||
double padding_top, padding_top_min; ///< Padding
|
||||
double padding_bottom, padding_bottom_min; ///< Padding
|
||||
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
|
||||
double paragraph_height; ///< Fixed height of paragraphs
|
||||
Direction direction; ///< In what direction is text layed out?
|
||||
Font font; ///< Font to use for the text
|
||||
SymbolFontRef symbol_font; ///< Symbol font for symbols in the text
|
||||
bool always_symbol; ///< Should everything be drawn as symbols?
|
||||
bool allow_formating; ///< Is formating (bold/italic/..) allowed?
|
||||
Scriptable<Alignment> alignment; ///< Alignment inside the box
|
||||
Scriptable<double>
|
||||
padding_left, padding_left_min, ///< Padding
|
||||
padding_right, padding_right_min, ///< Padding
|
||||
padding_top, padding_top_min, ///< Padding
|
||||
padding_bottom, padding_bottom_min, ///< Padding
|
||||
line_height_soft, ///< Line height for soft linebreaks
|
||||
line_height_hard, ///< Line height for hard linebreaks
|
||||
line_height_line, ///< Line height for <line> tags
|
||||
line_height_soft_max, ///< Maximum line height
|
||||
line_height_hard_max, ///< Maximum line height
|
||||
line_height_line_max, ///< Maximum line height
|
||||
paragraph_height; ///< Fixed height of paragraphs
|
||||
Direction direction; ///< In what direction is text layed out?
|
||||
// information from text rendering
|
||||
double content_width, content_height; ///< Size of the rendered text
|
||||
int content_lines; ///< Number of rendered lines
|
||||
double content_width, content_height; ///< Size of the rendered text
|
||||
int content_lines; ///< Number of rendered lines
|
||||
|
||||
virtual int update(Context&);
|
||||
virtual void initDependencies(Context&, const Dependency&) const;
|
||||
@@ -88,8 +89,8 @@ class TextValue : public Value {
|
||||
inline TextValue(const TextFieldP& field) : Value(field), last_update(1) {}
|
||||
DECLARE_VALUE_TYPE(Text, Defaultable<String>);
|
||||
|
||||
ValueType value; ///< The text of this value
|
||||
Age last_update; ///< When was the text last changed?
|
||||
ValueType value; ///< The text of this value
|
||||
Age last_update; ///< When was the text last changed?
|
||||
|
||||
virtual bool update(Context&);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user