changeset 17254:0e152834911a

vpotmeter fix, scroll in the correct direction
author ods15
date Tue, 27 Dec 2005 19:21:04 +0000
parents 338e5704c5b1
children 9e4602075cf0
files Gui/mplayer/common.c Gui/mplayer/mw.c Gui/mplayer/pb.c
diffstat 3 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/common.c	Tue Dec 27 13:01:22 2005 +0000
+++ b/Gui/mplayer/common.c	Tue Dec 27 19:21:04 2005 +0000
@@ -268,9 +268,9 @@
           PutImage( &item->Bitmap,
 	    item->x,item->y,
 	    item->phases,
-	    item->phases * ( item->value / 100.0f ) );
+	    item->phases * ( 1. - item->value / 100.0f ) );
           PutImage( &item->Mask,
-	    item->x,item->y + (int)( ( item->height - item->psy ) * item->value / 100.0f ),
+	    item->x,item->y + (int)( ( item->height - item->psy ) * ( 1. - item->value / 100.0f ) ),
 	    3,item->pressed );
           break;
      case itSLabel:
--- a/Gui/mplayer/mw.c	Tue Dec 27 13:01:22 2005 +0000
+++ b/Gui/mplayer/mw.c	Tue Dec 27 19:21:04 2005 +0000
@@ -432,12 +432,16 @@
           switch( itemtype )
            {
             case itPotmeter:
-	    case itVPotmeter:
             case itHPotmeter:
                  btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
 		 mplEventHandling( item->msg,item->value );
                  value=item->value;
                  break;
+	    case itVPotmeter:
+                 btnModify( item->msg, ( 1. - (float)( Y - item->y ) / item->height) * 100.0f );
+		 mplEventHandling( item->msg,item->value );
+                 value=item->value;
+                 break;
            }
           mplEventHandling( item->msg,value );
           itemtype=0;
@@ -476,7 +480,7 @@
                  item->value=(float)( X - item->x ) / item->width * 100.0f;
                  goto potihandled;
             case itVPotmeter:
-                 item->value=(float)( Y - item->y ) / item->height * 100.0f;
+                 item->value=(1. - (float)( Y - item->y ) / item->height) * 100.0f;
                  goto potihandled;
             case itHPotmeter:
                  item->value=(float)( X - item->x ) / item->width * 100.0f;
--- a/Gui/mplayer/pb.c	Tue Dec 27 13:01:22 2005 +0000
+++ b/Gui/mplayer/pb.c	Tue Dec 27 19:21:04 2005 +0000
@@ -154,12 +154,16 @@
 	switch( itemtype )
 	 {
 	  case itPotmeter:
-	  case itVPotmeter:
 	  case itHPotmeter:
 	       btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
 	       mplEventHandling( item->msg,item->value );
 	       value=item->value;
 	       break;
+	  case itVPotmeter:
+	       btnModify( item->msg, ( 1. - (float)( Y - item->y ) / item->height) * 100.0f );
+	       mplEventHandling( item->msg,item->value );
+	       value=item->value;
+	       break;
 	 }
 	mplEventHandling( item->msg,value );
 
@@ -188,6 +192,9 @@
 	  case itPotmeter:
 	       item->value=(float)( X - item->x ) / item->width * 100.0f;
 	       goto potihandled;
+	  case itVPotmeter:
+	       item->value=(1. - (float)( Y - item->y ) / item->height) * 100.0f;
+	       goto potihandled;
 	  case itHPotmeter:
 	       item->value=(float)( X - item->x ) / item->width * 100.0f;
 potihandled: