mothra: fix double button hit
dolink() was hitting the button a second time!
This commit is contained in:
parent
b408b386e1
commit
fe5ede9792
1 changed files with 4 additions and 10 deletions
|
@ -800,18 +800,8 @@ void doprev(Panel *p, int buttons, int index){
|
||||||
* Follow an html link
|
* Follow an html link
|
||||||
*/
|
*/
|
||||||
void dolink(Panel *p, int buttons, Rtext *word){
|
void dolink(Panel *p, int buttons, Rtext *word){
|
||||||
char *file, mapurl[NNAME];
|
|
||||||
Point coord;
|
|
||||||
int yoffs;
|
|
||||||
Action *a;
|
Action *a;
|
||||||
|
|
||||||
/* really a button, hit it */
|
|
||||||
if(word->p != nil && word->p != p && strcmp(word->p->kind, "button") == 0){
|
|
||||||
extern void pl_buttonhit(Panel *p, int buttons, int check);
|
|
||||||
pl_buttonhit(word->p, buttons, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
a=word->user;
|
a=word->user;
|
||||||
if(a == nil || (a->link == nil && a->image == nil))
|
if(a == nil || (a->link == nil && a->image == nil))
|
||||||
return;
|
return;
|
||||||
|
@ -819,6 +809,10 @@ void dolink(Panel *p, int buttons, Rtext *word){
|
||||||
hiturl(buttons, a->image ? a->image : a->link, 0);
|
hiturl(buttons, a->image ? a->image : a->link, 0);
|
||||||
else if(a->link){
|
else if(a->link){
|
||||||
if(a->ismap){
|
if(a->ismap){
|
||||||
|
char mapurl[NNAME];
|
||||||
|
Point coord;
|
||||||
|
int yoffs;
|
||||||
|
|
||||||
yoffs=plgetpostextview(p);
|
yoffs=plgetpostextview(p);
|
||||||
coord=subpt(subpt(mouse.xy, word->r.min), p->r.min);
|
coord=subpt(subpt(mouse.xy, word->r.min), p->r.min);
|
||||||
snprint(mapurl, sizeof(mapurl), "%s?%d,%d", a->link, coord.x, coord.y+yoffs);
|
snprint(mapurl, sizeof(mapurl), "%s?%d,%d", a->link, coord.x, coord.y+yoffs);
|
||||||
|
|
Loading…
Reference in a new issue