X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fgadgets.c;h=64f0e0a99d9a57bbedac20d6bc94be28698e82c2;hp=4cf008fc01eaaec6044f85d3de57e00bfd4cad36;hb=f7b47bbe40b05bc4d815f94dd1bcdc21596d4ff5;hpb=94b9816442fd27ab02bcef6f5d4aaf6740009fc5 diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 4cf008fc..64f0e0a9 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -1494,11 +1494,18 @@ void ClickOnGadget(struct GadgetInfo *gi, int button) if (button_status) HandleGadgets(-1, -1, 0); + int x = gi->x; + int y = gi->y; + + /* set cursor position to the end of the text for text input gadgets */ + if (gi->type & GD_TYPE_TEXT_INPUT) + x = gi->x + gi->width - 1; + /* simulate pressing mouse button over specified gadget */ - HandleGadgets(gi->x, gi->y, button); + HandleGadgets(x, y, button); /* simulate releasing mouse button over specified gadget */ - HandleGadgets(gi->x, gi->y, 0); + HandleGadgets(x, y, 0); } boolean HandleGadgets(int mx, int my, int button)