diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2022-09-02 23:18:09 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2022-09-02 23:18:09 +0300 |
commit | a1e01f4c026a389b94985b19678a0c69745ca248 (patch) | |
tree | e245393f148b58fe94c52a488759d0452a131247 /source/blender/blenkernel/intern/vfont.c | |
parent | 65a215b819346cc889b0e09b2d4d83b21e2185ec (diff) |
UI: 3D Text Caret
Changes to the text caret (cursor) when editing Text objects in the
3D Viewport.
See D15797 for more details and examples.
Differential Revision: https://developer.blender.org/D15797
Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/blenkernel/intern/vfont.c')
-rw-r--r-- | source/blender/blenkernel/intern/vfont.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/vfont.c b/source/blender/blenkernel/intern/vfont.c index 9a6f861eae8..e016cf8db84 100644 --- a/source/blender/blenkernel/intern/vfont.c +++ b/source/blender/blenkernel/intern/vfont.c @@ -1422,7 +1422,8 @@ static bool vfont_to_curve(Object *ob, for (i = 0; i <= selend; i++, ct++) { if (i >= selstart) { selboxes[i - selstart].x = ct->xof * font_size; - selboxes[i - selstart].y = ct->yof * font_size; + selboxes[i - selstart].y = (ct->yof - 0.25f) * font_size; + selboxes[i - selstart].h = font_size; } } } @@ -1481,17 +1482,17 @@ static bool vfont_to_curve(Object *ob, f = ef->textcurs[0]; - f[0] = font_size * (-0.1f * co + ct->xof); - f[1] = font_size * (0.1f * si + ct->yof); + f[0] = font_size * (-0.02f * co + ct->xof); + f[1] = font_size * (0.1f * si - (0.25f * co) + ct->yof); - f[2] = font_size * (0.1f * co + ct->xof); - f[3] = font_size * (-0.1f * si + ct->yof); + f[2] = font_size * (0.02f * co + ct->xof); + f[3] = font_size * (-0.1f * si - (0.25f * co) + ct->yof); - f[4] = font_size * (0.1f * co + 0.8f * si + ct->xof); - f[5] = font_size * (-0.1f * si + 0.8f * co + ct->yof); + f[4] = font_size * (0.02f * co + 0.8f * si + ct->xof); + f[5] = font_size * (-0.1f * si + 0.75f * co + ct->yof); - f[6] = font_size * (-0.1f * co + 0.8f * si + ct->xof); - f[7] = font_size * (0.1f * si + 0.8f * co + ct->yof); + f[6] = font_size * (-0.02f * co + 0.8f * si + ct->xof); + f[7] = font_size * (0.1f * si + 0.75f * co + ct->yof); } if (mode == FO_SELCHANGE) { |