diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2019-11-25 04:09:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-25 04:20:51 +0300 |
commit | b92ac3e2cbd7c64838e2cb760dd33c011f8d429d (patch) | |
tree | e62b9d54f3ca6671cbcde381485f20404972bf8c /source | |
parent | 249f4423ee1c28e7f8ad6fdfff6c61a1f3e6d53d (diff) |
UI: scale widget cursor by pixel size
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index f9e4248fde3..847ee37873b 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2163,7 +2163,6 @@ static void widget_draw_text(const uiFontStyle *fstyle, /* text button selection, cursor, composite underline */ if (but->editstr && but->pos != -1) { int but_pos_ofs; - int tx, ty; /* text button selection */ if ((but->selend - but->selsta) > 0) { @@ -2191,9 +2190,9 @@ static void widget_draw_text(const uiFontStyle *fstyle, immUniformColor4ubv(wcol->item); immRecti(pos, rect->xmin + selsta_draw, - rect->ymin + 2, + rect->ymin + U.pixelsize, min_ii(rect->xmin + selwidth_draw, rect->xmax - 2), - rect->ymax - 2); + rect->ymax - U.pixelsize); immUnbindProgram(); } @@ -2228,11 +2227,12 @@ static void widget_draw_text(const uiFontStyle *fstyle, immUniformColor3f(0.2f, 0.6f, 0.9f); - tx = rect->xmin + t + 2; - ty = rect->ymin + 2; - /* draw cursor */ - immRecti(pos, rect->xmin + t, ty, tx, rect->ymax - 2); + immRecti(pos, + rect->xmin + t - U.pixelsize, + rect->ymin + U.pixelsize, + rect->xmin + t + U.pixelsize, + rect->ymax - U.pixelsize); immUnbindProgram(); } |