Fix graph widget
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1098 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2008-06-08 Paul Giblock <drfaygo/at/gmail/dot/com>
|
||||
|
||||
* src/gui/widgets/graph.cpp:
|
||||
Fix graph widget
|
||||
|
||||
2008-06-08 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/ladspa_effect/tap/tap_deesser.c:
|
||||
|
||||
@@ -130,6 +130,8 @@ void graph::mouseMoveEvent ( QMouseEvent * _me )
|
||||
x = m_lastCursorX;
|
||||
}
|
||||
|
||||
printf("%d %d %d %d\n", height(), skip, x, y);
|
||||
|
||||
y = max( 2, min( y, height()-3 ) );
|
||||
|
||||
changeSampleAt( x, y );
|
||||
@@ -181,6 +183,7 @@ void graph::changeSampleAt(int _x, int _y)
|
||||
float xscale = static_cast<float>( model()->length() ) /
|
||||
( width()-4 );
|
||||
|
||||
|
||||
// consider border of background image
|
||||
_x -= 2;
|
||||
_y -= 2;
|
||||
@@ -189,7 +192,12 @@ void graph::changeSampleAt(int _x, int _y)
|
||||
float range = minVal - maxVal;
|
||||
float val = ( _y*range/( height()-4 ) ) + maxVal;
|
||||
|
||||
model()->setSampleAt( (int)( _x*xscale ), (int) val );
|
||||
printf("%d, (%d*%f/( %d-4 ) ) + %f \n", _x, _y, range, height(), maxVal );
|
||||
|
||||
float tmp = _y*range
|
||||
printf("%d, %d\n", _x, tmp );
|
||||
|
||||
model()->setSampleAt( (int)( _x*xscale ), val );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user