mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-01 16:19:43 +02:00
Invalidate Ruler, whenever anything the Updater uses is reassigned
This commit is contained in:
parent
edba1b5b28
commit
ec723466ba
@ -172,6 +172,15 @@ void Ruler::SetUnits(const TranslatableString &units)
|
||||
}
|
||||
}
|
||||
|
||||
void Ruler::SetDbMirrorValue( const double d )
|
||||
{
|
||||
if (mDbMirrorValue != d) {
|
||||
mDbMirrorValue = d;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
void Ruler::SetOrientation(int orient)
|
||||
{
|
||||
// wxHORIZONTAL || wxVERTICAL
|
||||
@ -303,14 +312,18 @@ void Ruler::SetNumberScale(const NumberScale *pScale)
|
||||
|
||||
void Ruler::OfflimitsPixels(int start, int end)
|
||||
{
|
||||
if ( mUserBits.empty() ) {
|
||||
int length = mLength;
|
||||
if (mOrientation == wxHORIZONTAL)
|
||||
mLength = mRight-mLeft;
|
||||
length = mRight - mLeft;
|
||||
else
|
||||
mLength = mBottom-mTop;
|
||||
if( mLength < 0 )
|
||||
length = mBottom - mTop;
|
||||
if( length < 0 )
|
||||
return;
|
||||
mUserBits.resize( static_cast<size_t>( mLength + 1 ), false );
|
||||
|
||||
auto size = static_cast<size_t>( length + 1 );
|
||||
if ( mUserBits.size() < size ) {
|
||||
mLength = length;
|
||||
mUserBits.resize( size, false );
|
||||
}
|
||||
|
||||
if (end < start)
|
||||
@ -323,6 +336,8 @@ void Ruler::OfflimitsPixels(int start, int end)
|
||||
|
||||
for(int i = start; i <= end; i++)
|
||||
mUserBits[i] = true;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
void Ruler::SetBounds(int left, int top, int right, int bottom)
|
||||
|
@ -76,7 +76,7 @@ class AUDACITY_DLL_API Ruler {
|
||||
// Specify the name of the units (like "dB") if you
|
||||
// want numbers like "1.6" formatted as "1.6 dB".
|
||||
void SetUnits(const TranslatableString &units);
|
||||
void SetDbMirrorValue( const double d ){ mDbMirrorValue = d ; };
|
||||
void SetDbMirrorValue( const double d );
|
||||
|
||||
// Logarithmic
|
||||
void SetLog(bool log);
|
||||
|
Loading…
x
Reference in New Issue
Block a user