diff --git a/lemonbar.c b/lemonbar.c index 5a327b5..b9fe2c9 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -100,7 +100,8 @@ static area_stack_t area_stack; static int slant; static int slant_width; static int full_slant_width; -static int slant_height; +static int slant_counter; +static int upslant; void update_gc (void) @@ -219,43 +220,26 @@ draw_char (monitor_t *mon, font_t *cur_font, int x, int align, uint16_t ch, int // Draw the background first if(slant_width) { - //odd = slant left, even = slant right - // if > 20, upslant. - int left=slant%2; - int i=0; - int cur_height=0; + // even = slant left, odd = slant right + int right = slant % 2; + int cur_height = 0; if(!full_slant_width) - { full_slant_width = slant_width * ch_width; - } - for(i=0; i 20) - { - cur_height*=-1; - } - - fill_rect(mon->pixmap, gc[GC_CLEAR], x+i, cur_height, 1, bh); + fill_rect(mon->pixmap, gc[GC_CLEAR], x+i, cur_height, 1, bh); } - - slant_width--; } else { @@ -571,15 +555,15 @@ parse (char *text) case 'F': fgc = parse_color(p, &p, dfgc); update_gc(); break; case 'U': ugc = parse_color(p, &p, dugc); update_gc(); break; - case 'E': case 'e': case 'D': case 'd': slant = *(p-1) - 'A'; // 4,36,5,37 - slant_width = (*p++)-'0'; - slant_height = 0; - full_slant_width=0; + slant_width = (*p++) - '0'; + full_slant_width = 0; + slant_counter = 0; + upslant = slant > 20 ? 1 : 0; break; case 'S': diff --git a/slant_demo.sh b/slant_demo.sh index 56836fc..9ea9905 100755 --- a/slant_demo.sh +++ b/slant_demo.sh @@ -17,6 +17,4 @@ ${sbg}%{E${Len}}$(space)${bg} - \ ${sbg}%{e${Len}}$(space)${bg} - \ ${sbg}%{D${Len}}$(space)${bg} - \ ${sbg}%{d${Len}}$(space)${bg} " \ -| ./lemonbar -g $geom -p - - +| ./lemonbar -g $geom -p -B "#000000"