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:37:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-12-03 11:53:40 +0300
commit1fdea43c29a7a0ffb65ec8049da574d4198d22af (patch)
treeb910b6604d60c6710570d4c133893ed2ce73abe1 /source/blender/editors/space_info/textview.h
parenta81fdefddebc0eec3e324cf6a9d8c51050d3e749 (diff)
Fix minor errors with text view margins for console/info editor
- Margins used duplicate define between files. - Cursor selection ignored margins. - Cursor wasn't scaling with DPI. Add a 'draw_rect' member which is the region rect with margins applied to make these checks clearer. This resolves issue pointed out in D6300, which complicated further refactoring.
Diffstat (limited to 'source/blender/editors/space_info/textview.h')
-rw-r--r--source/blender/editors/space_info/textview.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/space_info/textview.h b/source/blender/editors/space_info/textview.h
index aa0e924b461..ca5744dbe90 100644
--- a/source/blender/editors/space_info/textview.h
+++ b/source/blender/editors/space_info/textview.h
@@ -29,7 +29,9 @@ typedef struct TextViewContext {
int cwidth; /* shouldnt be needed! */
int console_width; /* shouldnt be needed! */
- int winx;
+ /** Area to draw: (0, 0, winx, winy) with a margin applied and scroll-bar subtracted. */
+ rcti draw_rect;
+
int ymin, ymax;
/* callbacks */
@@ -52,8 +54,11 @@ typedef struct TextViewContext {
} TextViewContext;
-int textview_draw(
- struct TextViewContext *tvc, const int draw, int mval[2], void **mouse_pick, int *pos_pick);
+int textview_draw(struct TextViewContext *tvc,
+ const int draw,
+ const int mval_init[2],
+ void **mouse_pick,
+ int *pos_pick);
#define TVC_LINE_FG (1 << 0)
#define TVC_LINE_BG (1 << 1)