1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-10 08:33:36 +02:00

Fix bug in 3a64b17...

... which make, for instance, excessive tick marks when in Mel spectrogram
scale
This commit is contained in:
Paul Licameli
2020-01-22 12:08:37 -05:00
parent a14d5c348a
commit 605a4056c9

View File

@@ -754,7 +754,10 @@ auto Ruler::MakeTick(
dc.SetFont( font );
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;
if ( orientation == wxHORIZONTAL ) {
@@ -820,6 +823,8 @@ auto Ruler::MakeTick(
for(i=0; i<strLen; i++)
bits[strPos+i] = true;
// Good to display the text
lab.text = str;
return { { strLeft, strTop, strW, strH }, lab };
}