diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-11-27 16:58:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-27 17:04:21 +0300 |
commit | f1c994c555da7c3e27984cc26b7f226badbe670d (patch) | |
tree | a42c43762e56cad6f59f50922ef4c341b5632826 /source/blender/editors/space_text/text_intern.h | |
parent | f6cefbef22c8c6583b4927c179dabac3eb57aa22 (diff) |
Cleanup: move space text vars into a runtime struct
Also use more descriptive names.
Diffstat (limited to 'source/blender/editors/space_text/text_intern.h')
-rw-r--r-- | source/blender/editors/space_text/text_intern.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 349682bb131..1a36b21952b 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -47,13 +47,14 @@ void text_update_cursor_moved(struct bContext *C); /* Padding around line numbers in character widths. */ #define TXT_NUMCOL_PAD 1.0f /* Total width of the optional line numbers column. */ -#define TXT_NUMCOL_WIDTH(st) (st->cwidth * (st->linenrs_tot + (2 * TXT_NUMCOL_PAD))) +#define TXT_NUMCOL_WIDTH(st) \ + (st->runtime.cwidth_px * (st->runtime.line_number_display_digits + (2 * TXT_NUMCOL_PAD))) /* Padding on left of body text in character units. */ #define TXT_BODY_LPAD 1.0f /* Left position of body text. */ #define TXT_BODY_LEFT(st) \ - (st->showlinenrs ? TXT_NUMCOL_WIDTH(st) : 0) + (TXT_BODY_LPAD * st->cwidth) + (st->showlinenrs ? TXT_NUMCOL_WIDTH(st) : 0) + (TXT_BODY_LPAD * st->runtime.cwidth_px) #define TXT_SCROLL_WIDTH U.widget_unit #define TXT_SCROLL_SPACE ((int)(0.1f * U.widget_unit)) @@ -61,9 +62,9 @@ void text_update_cursor_moved(struct bContext *C); /* Space between lines, in relation to letter height. */ #define TXT_LINE_VPAD 0.3f /* Space between lines. */ -#define TXT_LINE_SPACING(st) ((int)(TXT_LINE_VPAD * st->lheight_dpi)) +#define TXT_LINE_SPACING(st) ((int)(TXT_LINE_VPAD * st->runtime.lheight_px)) /* Total height of each line. */ -#define TXT_LINE_HEIGHT(st) ((int)((1.0f + TXT_LINE_VPAD) * st->lheight_dpi)) +#define TXT_LINE_HEIGHT(st) ((int)((1.0f + TXT_LINE_VPAD) * st->runtime.lheight_px)) #define SUGG_LIST_SIZE 7 #define SUGG_LIST_WIDTH 20 |