diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-09-05 04:21:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-05 04:33:14 +0300 |
commit | 312af01fb4faa7d1ff0dea4d2ef936caa9af4c67 (patch) | |
tree | 260a1b6625b210d319b2baf7433287051cc5ff78 /release/scripts/startup/bl_ui/properties_data_curve.py | |
parent | 053669e4aec11e5dbad61dd7308fe68a23f67034 (diff) |
3D Text: improvements to vertical alignment
They way Blender handles vertical alignment is very buggy:
- Top-Base: It works perfectly.
- Bottom: It is actually bottom-baseline,
and it fails when line size is != 1.0 when working with text boxes.
- Top: Poorly implemented, it should use font's ascent
(recommended distance from baseline),
so it has room for accents,
but it's not one line distance far from the origin (as it is now).
- Center: Poorly implemented.
This is tricky since there is no silver bullet.
To clear this situation I created a new option (Bottom-Baseline),
and addressed the issues above.
I'm getting the ascent and descent from freetype2,
and use this for padding above/below the text.
Also for vertically centering the text.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_curve.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_curve.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index 671cff4ebb4..9ba6bc70892 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -398,12 +398,13 @@ class DATA_PT_paragraph_alignment(CurveButtonsPanelText, Panel): def draw(self, context): layout = self.layout - layout.use_property_split = False + layout.use_property_split = True text = context.curve - layout.row().prop(text, "align_x", expand=True) - layout.row().prop(text, "align_y", expand=True) + col = layout.column() + col.prop(text, "align_x", text="Horizontal") + col.prop(text, "align_y", text="Vertical") class DATA_PT_paragraph_spacing(CurveButtonsPanelText, Panel): |