diff options
Diffstat (limited to 'src/libframe/frdraw.c')
-rw-r--r-- | src/libframe/frdraw.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/libframe/frdraw.c b/src/libframe/frdraw.c index c1cace42..2a3a95e0 100644 --- a/src/libframe/frdraw.c +++ b/src/libframe/frdraw.c @@ -137,15 +137,15 @@ frredraw(Frame *f) pt = frdrawsel0(f, pt, f->p1, f->nchars, f->cols[BACK], f->cols[TEXT]); } -void -frtick(Frame *f, Point pt, int ticked) +static void +_frtick(Frame *f, Point pt, int ticked) { Rectangle r; if(f->ticked==ticked || f->tick==0 || !ptinrect(pt, f->r)) return; - pt.x--; /* looks best just left of where requested */ - r = Rect(pt.x, pt.y, pt.x+FRTICKW, pt.y+f->font->height); + pt.x -= f->tickscale; /* looks best just left of where requested */ + r = Rect(pt.x, pt.y, pt.x+FRTICKW*f->tickscale, pt.y+f->font->height); /* can go into left border but not right */ if(r.max.x > f->r.max.x) r.max.x = f->r.max.x; @@ -157,6 +157,17 @@ frtick(Frame *f, Point pt, int ticked) f->ticked = ticked; } +void +frtick(Frame *f, Point pt, int ticked) +{ + if(f->tickscale != scalesize(f->display, 1)) { + if(f->ticked) + _frtick(f, pt, 0); + frinittick(f); + } + _frtick(f, pt, ticked); +} + Point _frdraw(Frame *f, Point pt) { |