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:
authorCampbell Barton <ideasman42@gmail.com>2019-12-03 11:58:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-12-03 11:59:11 +0300
commitc7e64f67ed8e0a0f1f7a4f3fa1bab55210140543 (patch)
treecb7b9df00643f1754b3241acd1f650cffb9465d2 /source/blender/editors/space_info
parent1fdea43c29a7a0ffb65ec8049da574d4198d22af (diff)
Cleanup: rename textview ymin/max
This is used for scrolling which wasn't obvious.
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r--source/blender/editors/space_info/info_draw.c4
-rw-r--r--source/blender/editors/space_info/textview.c14
-rw-r--r--source/blender/editors/space_info/textview.h3
3 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index a22983c15a8..f2f8b2da4db 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -266,8 +266,8 @@ static int info_textview_main__internal(struct SpaceInfo *sinfo,
tvc.sel_start = 0;
tvc.sel_end = 0;
tvc.lheight = 14 * UI_DPI_FAC; // sc->lheight;
- tvc.ymin = v2d->cur.ymin;
- tvc.ymax = v2d->cur.ymax;
+ tvc.scroll_ymin = v2d->cur.ymin;
+ tvc.scroll_ymax = v2d->cur.ymax;
info_textview_draw_rect_calc(ar, &tvc.draw_rect);
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c
index 0ebd8bdc065..a112929cf25 100644
--- a/source/blender/editors/space_info/textview.c
+++ b/source/blender/editors/space_info/textview.c
@@ -52,7 +52,7 @@ typedef struct ConsoleDrawContext {
/** number of characters that fit into the width of the console (fixed width) */
int console_width;
const rcti *draw_rect;
- int ymin, ymax;
+ int scroll_ymin, scroll_ymax;
int *xy; // [2]
int *sel; // [2]
/* bottom of view == 0, top of file == combine chars, end of line is lower then start. */
@@ -169,7 +169,7 @@ static int console_draw_string(ConsoleDrawContext *cdc,
MEM_freeN(offsets);
return 1;
}
- else if (y_next < cdc->ymin) {
+ else if (y_next < cdc->scroll_ymin) {
/* have not reached the drawable area so don't break */
cdc->xy[1] = y_next;
@@ -236,7 +236,7 @@ static int console_draw_string(ConsoleDrawContext *cdc,
cdc->xy[1] += cdc->lheight;
/* check if were out of view bounds */
- if (cdc->xy[1] > cdc->ymax) {
+ if (cdc->xy[1] > cdc->scroll_ymax) {
MEM_freeN(offsets);
return 0;
}
@@ -275,7 +275,7 @@ static int console_draw_string(ConsoleDrawContext *cdc,
cdc->xy[1] += cdc->lheight;
- if (cdc->xy[1] > cdc->ymax) {
+ if (cdc->xy[1] > cdc->scroll_ymax) {
MEM_freeN(offsets);
return 0;
}
@@ -309,7 +309,7 @@ int textview_draw(
CLAMPIS(mval_init[0], tvc->draw_rect.xmin, tvc->draw_rect.xmax) - tvc->draw_rect.xmin,
(mval_init[1] == INT_MAX) ?
INT_MAX :
- CLAMPIS(mval_init[1], tvc->draw_rect.ymin, tvc->draw_rect.ymax) + tvc->ymin,
+ CLAMPIS(mval_init[1], tvc->draw_rect.ymin, tvc->draw_rect.ymax) + tvc->scroll_ymin,
};
if (pos_pick) {
@@ -329,8 +329,8 @@ int textview_draw(
cdc.console_width = 1;
}
cdc.draw_rect = &tvc->draw_rect;
- cdc.ymin = tvc->ymin;
- cdc.ymax = tvc->ymax;
+ cdc.scroll_ymin = tvc->scroll_ymin;
+ cdc.scroll_ymax = tvc->scroll_ymax;
cdc.xy = xy;
cdc.sel = sel;
cdc.pos_pick = pos_pick;
diff --git a/source/blender/editors/space_info/textview.h b/source/blender/editors/space_info/textview.h
index ca5744dbe90..f7ec61fe65d 100644
--- a/source/blender/editors/space_info/textview.h
+++ b/source/blender/editors/space_info/textview.h
@@ -32,7 +32,8 @@ typedef struct TextViewContext {
/** Area to draw: (0, 0, winx, winy) with a margin applied and scroll-bar subtracted. */
rcti draw_rect;
- int ymin, ymax;
+ /** Scroll offset in pixels. */
+ int scroll_ymin, scroll_ymax;
/* callbacks */
int (*begin)(struct TextViewContext *tvc);