comparison Gui/mplayer/mw.c @ 17254:0e152834911a

vpotmeter fix, scroll in the correct direction
author ods15
date Tue, 27 Dec 2005 19:21:04 +0000
parents 0e1471d9da74
children f9a939c204ad
comparison
equal deleted inserted replaced
17253:338e5704c5b1 17254:0e152834911a
430 if ( currentselected == - 1 ) { itemtype=0; break; } 430 if ( currentselected == - 1 ) { itemtype=0; break; }
431 value=0; 431 value=0;
432 switch( itemtype ) 432 switch( itemtype )
433 { 433 {
434 case itPotmeter: 434 case itPotmeter:
435 case itVPotmeter:
436 case itHPotmeter: 435 case itHPotmeter:
437 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f ); 436 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
437 mplEventHandling( item->msg,item->value );
438 value=item->value;
439 break;
440 case itVPotmeter:
441 btnModify( item->msg, ( 1. - (float)( Y - item->y ) / item->height) * 100.0f );
438 mplEventHandling( item->msg,item->value ); 442 mplEventHandling( item->msg,item->value );
439 value=item->value; 443 value=item->value;
440 break; 444 break;
441 } 445 }
442 mplEventHandling( item->msg,value ); 446 mplEventHandling( item->msg,value );
474 break; 478 break;
475 case itPotmeter: 479 case itPotmeter:
476 item->value=(float)( X - item->x ) / item->width * 100.0f; 480 item->value=(float)( X - item->x ) / item->width * 100.0f;
477 goto potihandled; 481 goto potihandled;
478 case itVPotmeter: 482 case itVPotmeter:
479 item->value=(float)( Y - item->y ) / item->height * 100.0f; 483 item->value=(1. - (float)( Y - item->y ) / item->height) * 100.0f;
480 goto potihandled; 484 goto potihandled;
481 case itHPotmeter: 485 case itHPotmeter:
482 item->value=(float)( X - item->x ) / item->width * 100.0f; 486 item->value=(float)( X - item->x ) / item->width * 100.0f;
483 potihandled: 487 potihandled:
484 if ( item->value > 100.0f ) item->value=100.0f; 488 if ( item->value > 100.0f ) item->value=100.0f;