[Scummvm-cvs-logs] SF.net SVN: scummvm:[35441] scummvm/trunk/engines/agi/saveload.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri Dec 19 18:21:56 CET 2008


Revision: 35441
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35441&view=rev
Author:   eriktorbjorn
Date:     2008-12-19 17:21:55 +0000 (Fri, 19 Dec 2008)

Log Message:
-----------
Clicking in the scrollbar always caused the save/load list to scroll down a page.
Now it can scroll up a page again.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/saveload.cpp

Modified: scummvm/trunk/engines/agi/saveload.cpp
===================================================================
--- scummvm/trunk/engines/agi/saveload.cpp	2008-12-19 16:55:54 UTC (rev 35440)
+++ scummvm/trunk/engines/agi/saveload.cpp	2008-12-19 17:21:55 UTC (rev 35441)
@@ -567,6 +567,21 @@
 	for (;;) {
 		int sbPos = 0;
 
+		// Use the extreme scrollbar positions only if the extreme
+		// slots are in sight. (We have to calculate this even if we
+		// don't redraw the save slots, because it's also used for
+		// clicking in the scrollbar.
+
+		if (_firstSlot == 0)
+			sbPos = 1;
+		else if (_firstSlot == NUM_SLOTS - NUM_VISIBLE_SLOTS)
+			sbPos = NUM_VISIBLE_SLOTS - 2;
+		else {
+			sbPos = 2 + (_firstSlot * (NUM_VISIBLE_SLOTS - 4)) / (NUM_SLOTS - NUM_VISIBLE_SLOTS - 1);
+			if (sbPos >= NUM_VISIBLE_SLOTS - 3)
+				sbPos = NUM_VISIBLE_SLOTS - 3;
+		}
+
 		if (oldFirstSlot != _firstSlot || oldActive != active) {
 			char dstr[64];
 			for (i = 0; i < NUM_VISIBLE_SLOTS; i++) {
@@ -580,19 +595,6 @@
 			char downArrow[] = "v";
 			char scrollBar[] = " ";
 
-			// Use the extreme scrollbar positions only if the
-			// extreme slots are in sight.
-
-			if (_firstSlot == 0)
-				sbPos = 1;
-			else if (_firstSlot == NUM_SLOTS - NUM_VISIBLE_SLOTS)
-				sbPos = NUM_VISIBLE_SLOTS - 2;
-			else {
-				sbPos = 2 + (_firstSlot * (NUM_VISIBLE_SLOTS - 4)) / (NUM_SLOTS - NUM_VISIBLE_SLOTS - 1);
-				if (sbPos >= NUM_VISIBLE_SLOTS - 3)
-					sbPos = NUM_VISIBLE_SLOTS - 3;
-			}
-
 			for (i = 1; i < NUM_VISIBLE_SLOTS - 1; i++)
 				printText(scrollBar, 35, hm + 1, vm + 4 + i, 1, MSG_BOX_COLOUR, 7, true);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list