Fix Python console cursor height
authorCampbell Barton <ideasman42@gmail.com>
Fri, 22 May 2020 02:36:39 +0000 (12:36 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 22 May 2020 02:36:39 +0000 (12:36 +1000)
source/blender/editors/space_console/console_draw.c
source/blender/editors/space_info/textview.c
source/blender/editors/space_info/textview.h

index 6b741363d423dea51e8ab30ef42452113c213273..805e9608fec8865c30d1933ebda9e5918b525b8c 100644 (file)
@@ -142,10 +142,7 @@ static void console_cursor_wrap_offset(
   return;
 }
 
-static void console_textview_draw_cursor(TextViewContext *tvc,
-                                         int cwidth,
-                                         int columns,
-                                         int descender)
+static void console_textview_draw_cursor(TextViewContext *tvc, int cwidth, int columns)
 {
   int pen[2];
   {
@@ -171,8 +168,7 @@ static void console_textview_draw_cursor(TextViewContext *tvc,
   immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
   immUniformThemeColor(TH_CONSOLE_CURSOR);
 
-  immRectf(
-      pos, pen[0] - U.pixelsize, pen[1], pen[0] + U.pixelsize, pen[1] + tvc->lheight + descender);
+  immRectf(pos, pen[0] - U.pixelsize, pen[1], pen[0] + U.pixelsize, pen[1] + tvc->lheight);
 
   immUnbindProgram();
 }
index 5d5c41597b41316753fc31815772d5e38349ef2c..8076d3d7eaf69d721bfd6ca8bec1ba8a170beb5a 100644 (file)
@@ -408,7 +408,7 @@ int textview_draw(TextViewContext *tvc,
       if (do_draw) {
         /* We always want the cursor to draw. */
         if (tvc->draw_cursor && iter_index == 0) {
-          tvc->draw_cursor(tvc, tds.cwidth, tds.columns, tds.lofs);
+          tvc->draw_cursor(tvc, tds.cwidth, tds.columns);
         }
 
         /* When drawing, if we pass v2d->cur.ymax, then quit. */
index 8eef4ef5d56ca14b159aa8b31261e9067638567f..41f8baf634e966520504349c49270ec4e4dac4e2 100644 (file)
@@ -60,7 +60,7 @@ typedef struct TextViewContext {
                                               int *r_icon,
                                               uchar r_icon_fg[4],
                                               uchar r_icon_bg[4]);
-  void (*draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns, int descender);
+  void (*draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns);
   /* constant theme colors */
   void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]);
   const void *iter;