diff options
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/space_text.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 8 |
4 files changed, 6 insertions, 20 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 98faf89f8ae..af783051661 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -138,13 +138,7 @@ static void text_listener(const wmSpaceTypeListenerParams *params) switch (wmn->data) { case ND_DISPLAY: - ED_area_tag_redraw(area); - break; case ND_CURSOR: - if (st->text && st->text == wmn->reference) { - text_scroll_to_cursor__area(st, area, true); - } - ED_area_tag_redraw(area); break; } @@ -160,13 +154,8 @@ static void text_listener(const wmSpaceTypeListenerParams *params) ATTR_FALLTHROUGH; /* fall down to tag redraw */ case NA_ADDED: case NA_REMOVED: - ED_area_tag_redraw(area); - break; case NA_SELECTED: - if (st->text && st->text == wmn->reference) { - text_scroll_to_cursor__area(st, area, true); - } - + ED_area_tag_redraw(area); break; } diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 8b8034124d9..17831c95575 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1739,7 +1739,7 @@ void text_update_character_width(SpaceText *st) /* Moves the view to the cursor location, * also used to make sure the view isn't outside the file */ -void text_scroll_to_cursor(SpaceText *st, ARegion *region, const bool center) +void ED_text_scroll_to_cursor(SpaceText *st, ARegion *region, const bool center) { Text *text; int i, x, winx = region->winx; @@ -1818,7 +1818,7 @@ void text_scroll_to_cursor__area(SpaceText *st, ScrArea *area, const bool center region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); if (region) { - text_scroll_to_cursor(st, region, center); + ED_text_scroll_to_cursor(st, region, center); } } diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index a33af56e11a..241e0133a8a 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -39,7 +39,6 @@ void draw_text_main(struct SpaceText *st, struct ARegion *region); void text_update_line_edited(struct TextLine *line); void text_update_edited(struct Text *text); void text_update_character_width(struct SpaceText *st); -void text_scroll_to_cursor(struct SpaceText *st, struct ARegion *region, const bool center); void text_scroll_to_cursor__area(struct SpaceText *st, struct ScrArea *area, const bool center); void text_update_cursor_moved(struct bContext *C); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 526285c076a..e6803d12a42 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -506,12 +506,10 @@ static int text_unlink_exec(bContext *C, wmOperator *UNUSED(op)) if (text->id.prev) { st->text = text->id.prev; text_update_cursor_moved(C); - WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text); } else if (text->id.next) { st->text = text->id.next; text_update_cursor_moved(C); - WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text); } } @@ -3200,7 +3198,7 @@ static void text_cursor_set_apply(bContext *C, wmOperator *op, const wmEvent *ev if (event->type == TIMER) { text_cursor_set_to_pos(st, region, event->mval[0], event->mval[1], 1); - text_scroll_to_cursor(st, region, false); + ED_text_scroll_to_cursor(st, region, false); WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text); } } @@ -3210,7 +3208,7 @@ static void text_cursor_set_apply(bContext *C, wmOperator *op, const wmEvent *ev if (event->type == TIMER) { text_cursor_set_to_pos( st, region, CLAMPIS(event->mval[0], 0, region->winx), event->mval[1], 1); - text_scroll_to_cursor(st, region, false); + ED_text_scroll_to_cursor(st, region, false); WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text); } } @@ -3219,7 +3217,7 @@ static void text_cursor_set_apply(bContext *C, wmOperator *op, const wmEvent *ev if (event->type != TIMER) { text_cursor_set_to_pos(st, region, event->mval[0], event->mval[1], 1); - text_scroll_to_cursor(st, region, false); + ED_text_scroll_to_cursor(st, region, false); WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, st->text); ssel->mval_prev[0] = event->mval[0]; |