diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-10 19:17:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-10 19:30:26 +0300 |
commit | 3443686399feb4f96a9ea85f52f6750388b883a2 (patch) | |
tree | 7e4c91319ba3a2d13d4e83a43c0b690ed8e63547 /source/blender/makesrna/intern/rna_sequencer.c | |
parent | 9a3dfa1f21168c19a3346bb4813b1313deb6fb18 (diff) |
Sequencer: changes to text effect strip
- default alignment to lower center.
- placement is now relative,
so changing output size keeps correct placement.
- instead of center override, add align option (left/right/center).
Also don't use pixel-size for setting the font size, on new strips.
Better not have UI prefs impact low level API's.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index d7311b93b2f..535428e7d6a 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -2307,23 +2307,34 @@ static void rna_def_gaussian_blur(StructRNA *srna) static void rna_def_text(StructRNA *srna) { + static EnumPropertyItem text_align_items[] = { + {SEQ_TEXT_ALIGN_LEFT, "LEFT", 0, "Left", ""}, + {SEQ_TEXT_ALIGN_CENTER, "CENTER", 0, "Center", ""}, + {SEQ_TEXT_ALIGN_RIGHT, "RIGHT", 0, "Right", ""}, + {0, NULL, 0, NULL, NULL} + }; + PropertyRNA *prop; RNA_def_struct_sdna_from(srna, "TextVars", "effectdata"); - prop = RNA_def_property(srna, "text_size", PROP_INT, PROP_UNSIGNED); + prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "text_size"); RNA_def_property_ui_text(prop, "Size", "Size of the text"); RNA_def_property_ui_range(prop, 0.0f, 1000, 1, -1); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - prop = RNA_def_property(srna, "xpos", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "X Position", "X position of the text"); - RNA_def_property_ui_range(prop, -1000, 1000, 1, -1); + prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "loc"); + RNA_def_property_ui_text(prop, "Location", "Location of the text"); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - prop = RNA_def_property(srna, "ypos", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Y Position", "Y position of the text"); - RNA_def_property_ui_range(prop, -1000, 1000, 1, -1); + prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "align"); + RNA_def_property_enum_items(prop, text_align_items); + RNA_def_property_ui_text(prop, "Align", ""); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE); @@ -2331,14 +2342,9 @@ static void rna_def_text(StructRNA *srna) RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", TEXT_SEQ_SHADOW); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TEXT_SHADOW); RNA_def_property_ui_text(prop, "Shadow", "draw text with shadow"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - - prop = RNA_def_property(srna, "use_autocenter", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", TEXT_SEQ_AUTO_CENTER); - RNA_def_property_ui_text(prop, "Auto-Center", "draw text centered in x axis"); - RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); } static EffectInfo def_effects[] = { |