aboutsummaryrefslogtreecommitdiff
path: root/swt.c
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-04-17 17:52:43 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2023-04-17 17:52:43 +0200
commit540783559d919f287cbef316e36fe854ba84f529 (patch)
tree7dc2a6cfcaaef7a45cadea2c97f3ef81c1c56ef9 /swt.c
parent9a52082f2c08589476a539d4c55ad268ae13ac0f (diff)
fix cursor drawing
Diffstat (limited to 'swt.c')
-rw-r--r--swt.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/swt.c b/swt.c
index fadbb4b..a6160fd 100644
--- a/swt.c
+++ b/swt.c
@@ -225,25 +225,18 @@ wdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) {
draw_glyph(og, ox, oy);
g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE;
- g.bg = defaultfg;
- g.fg = defaultbg;
switch(win.cursor) {
- case 0:
- case 1:
+ case 0: /* Block */
+ case 1:
case 2:
- draw_rect(
- win.canvas,
- borderpx + cx * win.fontcache->box.width,
- borderpx + cy * win.fontcache->box.height,
- win.fontcache->box.width,
- win.fontcache->box.height,
- colors[defaultcursorcolor]
- );
+ g.bg = defaultfg;
+ g.fg = defaultbg;
draw_glyph(g, cx, cy);
break;
- case 3:
+ case 3: /* Underline */
case 4:
+ draw_glyph(g, cx, cy);
draw_rect(
win.canvas,
borderpx + cx * win.fontcache->box.width,
@@ -252,10 +245,10 @@ wdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) {
cursorthickness,
colors[defaultcursorcolor]
);
- draw_glyph(g, cx, cy);
break;
- case 5:
+ case 5: /* Bar */
case 6:
+ draw_glyph(g, cx, cy);
draw_rect(
win.canvas,
borderpx + cx * win.fontcache->box.width,
@@ -264,7 +257,6 @@ wdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) {
win.fontcache->box.height,
colors[defaultcursorcolor]
);
- draw_glyph(g, cx, cy);
break;
}
}