Ticket #8764: lure_mouse_scroll.patch
File lure_mouse_scroll.patch, 1.8 KB (added by , 17 years ago) |
---|
-
surface.cpp
894 894 abortFlag = true; 895 895 break; 896 896 } 897 if (events.type() == Common::EVENT_MOUSEMOVE) { 897 if (events.type() == Common::EVENT_MOUSEMOVE || 898 events.type() == Common::EVENT_WHEELUP || events.type() == Common::EVENT_WHEELDOWN) { 898 899 // Mouse movement 899 900 int lineNum; 900 if ((mouse.x() < (SAVE_DIALOG_X + DIALOG_EDGE_SIZE)) ||901 (mouse.x() >= (SAVE_DIALOG_X + s->width() - DIALOG_EDGE_SIZE)) ||902 (mouse.y() < SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y) ||903 (mouse.y() >= SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y + numSaves * FONT_HEIGHT))904 // Outside displayed lines905 lineNum = -1;906 else907 lineNum = (mouse.y() - (SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y)) / FONT_HEIGHT;908 901 902 if (events.type() == Common::EVENT_MOUSEMOVE) { 903 if ((mouse.x() < (SAVE_DIALOG_X + DIALOG_EDGE_SIZE)) || 904 (mouse.x() >= (SAVE_DIALOG_X + s->width() - DIALOG_EDGE_SIZE)) || 905 (mouse.y() < SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y) || 906 (mouse.y() >= SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y + numSaves * FONT_HEIGHT)) 907 // Outside displayed lines 908 lineNum = -1; 909 else 910 lineNum = (mouse.y() - (SAVE_DIALOG_Y + SR_SAVEGAME_NAMES_Y)) / FONT_HEIGHT; 911 } else if (events.type() == Common::EVENT_WHEELUP) { 912 if (selectedLine > 0) { 913 lineNum = selectedLine - 1; 914 } 915 } else if (events.type() == Common::EVENT_WHEELDOWN) { 916 if (selectedLine < DIALOG_EDGE_SIZE) { 917 lineNum = selectedLine + 1; 918 } 919 } 920 909 921 if (lineNum != selectedLine) { 910 922 if (selectedLine != -1) 911 923 // Deselect previously selected line