mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-27 15:08:39 +01:00
Fix bug in 3a64b17...
... which make, for instance, excessive tick marks when in Mel spectrogram scale
This commit is contained in:
@@ -754,7 +754,10 @@ auto Ruler::MakeTick(
|
|||||||
dc.SetFont( font );
|
dc.SetFont( font );
|
||||||
|
|
||||||
wxCoord strW, strH, strD, strL;
|
wxCoord strW, strH, strD, strL;
|
||||||
dc.GetTextExtent(lab.text.Translation(), &strW, &strH, &strD, &strL);
|
auto str = lab.text;
|
||||||
|
// Do not put the text into results until we are sure it does not overlap
|
||||||
|
lab.text = {};
|
||||||
|
dc.GetTextExtent(str.Translation(), &strW, &strH, &strD, &strL);
|
||||||
|
|
||||||
int strPos, strLen, strLeft, strTop;
|
int strPos, strLen, strLeft, strTop;
|
||||||
if ( orientation == wxHORIZONTAL ) {
|
if ( orientation == wxHORIZONTAL ) {
|
||||||
@@ -820,6 +823,8 @@ auto Ruler::MakeTick(
|
|||||||
for(i=0; i<strLen; i++)
|
for(i=0; i<strLen; i++)
|
||||||
bits[strPos+i] = true;
|
bits[strPos+i] = true;
|
||||||
|
|
||||||
|
// Good to display the text
|
||||||
|
lab.text = str;
|
||||||
return { { strLeft, strTop, strW, strH }, lab };
|
return { { strLeft, strTop, strW, strH }, lab };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user