Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2019-11-20 23:59:19 +0300
committerHarley Acheson <harley.acheson@gmail.com>2019-11-20 23:59:19 +0300
commit8c6ce742391b2b8798143a4a2c2224ebbeb7f1ec (patch)
tree19a14cc1b2fdf37d71d0112955ec33d725126b97 /source/blender/editors/space_text/text_ops.c
parent0418e2894467ee53a319b1f865422d8e5b139a03 (diff)
UI: Text Editor Visual Changes
Various small changes to Text Editor, mostly to do with scaling, alignment, and theme support. Differential Revision: https://developer.blender.org/D6268 Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r--source/blender/editors/space_text/text_ops.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index f9557225b6b..864c7912074 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -2544,7 +2544,7 @@ static void text_scroll_apply(bContext *C, wmOperator *op, const wmEvent *event)
* line offset but taken together should still scroll */
if (!tsc->scrollbar) {
st->scroll_accum[0] += -tsc->delta[0] / (float)st->cwidth;
- st->scroll_accum[1] += tsc->delta[1] / (float)(st->lheight_dpi + TXT_LINE_SPACING);
+ st->scroll_accum[1] += tsc->delta[1] / (float)(TXT_LINE_HEIGHT(st));
}
else {
st->scroll_accum[1] += -tsc->delta[1] * st->pix_per_line;
@@ -2982,15 +2982,9 @@ static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, con
{
Text *text = st->text;
text_update_character_width(st);
- y = (ar->winy - 2 - y) / (st->lheight_dpi + TXT_LINE_SPACING);
-
- if (st->showlinenrs) {
- x -= TXT_OFFSET + TEXTXLOC;
- }
- else {
- x -= TXT_OFFSET;
- }
+ y = (ar->winy - 2 - y) / TXT_LINE_HEIGHT(st);
+ x -= TXT_BODY_LEFT(st);
if (x < 0) {
x = 0;
}
@@ -3261,7 +3255,8 @@ static int text_line_number_invoke(bContext *C, wmOperator *UNUSED(op), const wm
return OPERATOR_PASS_THROUGH;
}
- if (!(mval[0] > 2 && mval[0] < (TXT_OFFSET + TEXTXLOC) && mval[1] > 2 &&
+ if (!(mval[0] > 2 && mval[0] < (TXT_NUMCOL_WIDTH(st) + (TXT_BODY_LPAD * st->cwidth)) &&
+ mval[1] > 2 &&
mval[1] < ar->winy - 2)) {
return OPERATOR_PASS_THROUGH;
}