Skip to content

Commit

Permalink
Correctly read the track height for the project
Browse files Browse the repository at this point in the history
Resolves audacity#6248
  • Loading branch information
crsib committed Apr 9, 2024
1 parent 435ede5 commit 86bc96d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tracks/ui/ChannelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Paul Licameli split from TrackPanel.cpp
#include "XMLTagHandler.h"
#include "XMLWriter.h"

#include <sstream>

ChannelView::ChannelView(const std::shared_ptr<Channel> &pChannel)
: CommonChannelCell{ pChannel }
Expand Down Expand Up @@ -121,10 +120,11 @@ void ChannelView::AdjustPositions()

namespace {
// Append a channel number to a base attribute name unless it is 0
std::string AttributeName(std::string name, size_t index) {
std::stringstream stream{ name };
stream << index;
return stream.str();
std::string AttributeName(const std::string& name, size_t index) {
if (index == 0)
return name;

return name + std::to_string(index);
}
std::string HeightAttributeName(size_t index) {
return AttributeName("height", index);
Expand Down

0 comments on commit 86bc96d

Please sign in to comment.