Skip to content

Commit

Permalink
Fix MSEG horizontal ruler text issue (#7806)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkruselj authored Sep 28, 2024
1 parent 952217b commit e09d122
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/surge-xt/gui/overlays/MSEGEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,21 +858,21 @@ struct MSEGCanvas : public juce::Component, public Surge::GUI::SkinConsumingComp
if (!(c & TickDrawStyle::kNoLabel))
{

auto sw = 0.f;
int sw = 0;

if (fmod(t, 1.f) == 0.f)
{
g.setColour(skin->getColor(Colors::MSEGEditor::Axis::Text));
g.setFont(primaryFont);
txt = fmt::format("{:d}", int(t));
sw = juce::GlyphArrangement::getStringWidth(primaryFont, txt);
sw = juce::GlyphArrangement::getStringWidthInt(primaryFont, txt);
}
else
{
g.setColour(skin->getColor(Colors::MSEGEditor::Axis::SecondaryText));
g.setFont(secondaryFont);
txt = fmt::format("{:5.2f}", t);
sw = juce::GlyphArrangement::getStringWidth(secondaryFont, txt);
sw = juce::GlyphArrangement::getStringWidthInt(secondaryFont, txt);
}

g.drawText(txt, px - (sw / 2), haxisArea.getY() + 2, sw, yofs,
Expand Down

0 comments on commit e09d122

Please sign in to comment.