diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-01-08 03:45:49 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-01-08 03:45:49 +0100 |
commit | 7295fa71a42de4a5bb4f2449005d71251899d062 (patch) | |
tree | 81db0ac938594f67e310a5a800aa11198e1ae511 /sys/src/libdraw/emenuhit.c | |
parent | 4041ea394ba19b45122ed8f661478ef9b562e138 (diff) |
libdraw: fix wrong menusel() calculation for menuhit() (noticable with small fonts)
the text for a menu entry is drawn from:
y = textr.min.y + i*(font->height+Vspacing);
but we calculated the item from:
r = insetrect(textr);
i = (p.y - r.min.y) / (font->height+Vspacing);
the insetrect is wrong.
Diffstat (limited to 'sys/src/libdraw/emenuhit.c')
-rw-r--r-- | sys/src/libdraw/emenuhit.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/sys/src/libdraw/emenuhit.c b/sys/src/libdraw/emenuhit.c index d1f23a4aa..8e34fe942 100644 --- a/sys/src/libdraw/emenuhit.c +++ b/sys/src/libdraw/emenuhit.c @@ -68,7 +68,6 @@ menurect(Rectangle r, int i) static int menusel(Rectangle r, Point p) { - r = insetrect(r, Margin); if(!ptinrect(p, r)) return -1; return (p.y-r.min.y)/(font->height+Vspacing); |