Skip to content

Commit

Permalink
Drag to Resize
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul committed Sep 3, 2021
1 parent 4c91cc4 commit 1d905da
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/surge_synth_juce/SurgeSynthEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,19 @@ SurgeSynthEditor::~SurgeSynthEditor()

void SurgeSynthEditor::handleAsyncUpdate() {}

void SurgeSynthEditor::paint(juce::Graphics &g) {}
void SurgeSynthEditor::paint(juce::Graphics &g) { g.fillAll(juce::Colours::grey); }

void SurgeSynthEditor::idle() { adapter->idle(); }

void SurgeSynthEditor::resized()
{
drawExtendedControls = adapter->getShowVirtualKeyboard();
auto w = getWidth();
auto h = getHeight() - (drawExtendedControls ? extraYSpaceForVirtualKeyboard : 0);
auto wR = 1.0 * w / adapter->getWindowSizeX();
auto hR = 1.0 * h / adapter->getWindowSizeY();
auto zfn = std::min(wR, hR);

bool addTempo = processor.wrapperType == juce::AudioProcessor::wrapperType_Standalone;
if (drawExtendedControls)
{
Expand All @@ -116,6 +122,9 @@ void SurgeSynthEditor::resized()
tempoLabel->setVisible(false);
tempoTypein->setVisible(false);
}

if (zfn != 1.0)
adapter->setZoomFactor(adapter->getZoomFactor() * zfn, false);
}

void SurgeSynthEditor::parentHierarchyChanged()
Expand Down

0 comments on commit 1d905da

Please sign in to comment.