Skip to content

Commit

Permalink
refactor: Simplify constrainer variable naming and remove debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunix-420 committed Feb 13, 2025
1 parent 2cd5170 commit 6d44c89
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/app/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ PluginEditor::PluginEditor(PluginProcessor& p)
setResizable(true, true);
}

if (auto* _constrainer = getConstrainer()) {
if (auto* constrainer = getConstrainer()) {
const auto aspectRatio = (double)baseWidth / (double)baseHeight;
_constrainer->setFixedAspectRatio(aspectRatio);
constrainer->setFixedAspectRatio(aspectRatio);
const auto minWidth = baseWidth / 2;
const auto minHeight = baseHeight / 2;
const auto maxWidth = baseWidth * 4;
const auto maxHeight = baseHeight * 4;
_constrainer->setSizeLimits(minWidth, minHeight, maxWidth, maxHeight);
constrainer->setSizeLimits(minWidth, minHeight, maxWidth, maxHeight);
}

addAndMakeVisible(compositor);
Expand Down Expand Up @@ -69,13 +69,14 @@ PluginEditor::resized()
// Set the bounds of the compositor to the bounds of the PluginEditor
compositor.setBoundsRelative(0.0f, 0.0f, 1.0f, 1.0f);

int w = getWidth();
int h = getHeight();
std::cout << "===== RESIZE =====" << std::endl;
std::cout << w << " " << h << std::endl;
std::cout << TopLevelWindow::getTopLevelWindow(0)->getWidth() << " "
<< TopLevelWindow::getTopLevelWindow(0)->getHeight() << std::endl;
std::cout << "------------------" << std::endl;
std::cout << "newSize: " << newSize << std::endl;
std::cout << "==================" << std::endl;
// int w = getWidth();
// int h = getHeight();
// std::cout << "===== RESIZE =====" << std::endl;
// std::cout << w << " " << h << std::endl;
// std::cout << TopLevelWindow::getTopLevelWindow(0)->getWidth() << " "
// << TopLevelWindow::getTopLevelWindow(0)->getHeight() <<
// std::endl;
// std::cout << "------------------" << std::endl;
// std::cout << "newSize: " << newSize << std::endl;
// std::cout << "==================" << std::endl;
}

0 comments on commit 6d44c89

Please sign in to comment.