-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
suggest a fix for precision on knob dragging #3075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d0b437e
51a4468
75c3906
2cb8fae
30bd4e8
5c3dd0f
0794364
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -275,9 +275,10 @@ float AutomatableModel::inverseScaledValue( float value ) const | |
|
|
||
| QString AutomatableModel::displayValue( const float val ) const | ||
| { | ||
| const FloatModel *floatmodel = dynamic_cast<const FloatModel*>( this ); | ||
| switch( m_dataType ) | ||
| { | ||
| case Float: return QString::number( castValue<float>( scaledValue( val ) ) ); | ||
| case Float: return QString::number( castValue<float>( scaledValue( floatmodel->getRoundedValue() ) ) ); | ||
| case Integer: return QString::number( castValue<int>( scaledValue( val ) ) ); | ||
| case Bool: return QString::number( castValue<bool>( scaledValue( val ) ) ); | ||
| } | ||
|
|
@@ -713,6 +714,23 @@ float AutomatableModel::globalAutomationValueAt( const MidiTime& time ) | |
| } | ||
| } | ||
|
|
||
| float FloatModel::getRoundedValue() const | ||
| { | ||
| return static_cast<float>( static_cast<int>( value() / step<float>() + 0.5 ) ) * step<float>(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is causing a problem in the tripleoscillator coarse detune knobs:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay, got a fix for that. Is there an issue filed for? @Umcaruje |
||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| float FloatModel::getDigitCount() | ||
| { | ||
| float steptemp = step<float>(); | ||
| int digits = 0; | ||
| while ( steptemp < 1 ) | ||
| { | ||
| steptemp = steptemp / 0.1f; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. steptemp = steptemp * 10.0f; // easier to figure, and probably faster (but I guess the compiler already optimise it...)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, I added this in this PR #3597. |
||
| digits++; | ||
| } | ||
| return digits; | ||
| } | ||
|
|
||



There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is used to convert any value into a string, not just the current value.

ResetandPaste valueare now incorrect:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to look into it. Thank you for the hint!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is stupid. My intention was to fix the mixer bug ( 1.2345 % means 123,45 % ). I guess I revert this and search an other solution for this.