[vlc-devel] [PATCH] Qt: fix rotation filter values

Rémi Denis-Courmont remi at remlab.net
Mon Mar 30 20:46:47 CEST 2015


---
 modules/gui/qt4/components/extended_panels.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index d05c0b3..7059a29 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -549,7 +549,7 @@ void ExtVideo::setWidgetValue( QObject *widget )
         else if( checkbox ) checkbox->setCheckState( val.i_int? Qt::Checked
                                                               : Qt::Unchecked );
         else if( spinbox )  spinbox->setValue( val.i_int );
-        else if( dial )     dial->setValue( ( 540-val.i_int )%360 );
+        else if( dial )     dial->setValue( (360 - val.i_int) % 360 );
         else if( lineedit )
         {
             char str[30];
@@ -564,7 +564,7 @@ void ExtVideo::setWidgetValue( QObject *widget )
     {
         if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */
         else if( doublespinbox ) doublespinbox->setValue( val.f_float );
-        else if( dial ) dial->setValue( (540 - lroundf(val.f_float)) % 360 );
+        else if( dial ) dial->setValue( (360 - lroundf(val.f_float)) % 360 );
         else msg_Warn( p_intf, "Could not find the correct Float widget" );
     }
     else if( i_type == VLC_VAR_STRING )
@@ -683,8 +683,8 @@ void ExtVideo::updateFilterOptions()
     else if( spinbox ) i_int = spinbox->value();
     else if( doublespinbox ) f_float = doublespinbox->value();
     else if( dial ) {
-        i_int = (540 - dial->value()) % 360;
-        f_float = (540 - dial->value()) / 360.;
+        i_int = (360 - dial->value()) % 360;
+        f_float = i_int;
     }
     else if( lineedit ) {
         i_int = lineedit->text().toInt( NULL,16 );
-- 
2.1.4




More information about the vlc-devel mailing list