text: /*
    ==============================================================================
  
      UI-InitWindow.cpp
      Created: 24 Oct 2021 1:46:10am
      Author:  Landon Viator
  
    ==============================================================================
  */
  
  #include "../PluginEditor.h"
  
  void LV50AAudioProcessorEditor::initWindow()
  {
      // Grab the window instance and create a rectangle
      juce::Rectangle<int> r = juce::Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
      
      // Using the width is more useful than the height, because we know the height will always be < than width
      int x = r.getWidth();
      
      // Plugin window will always initialize to half the screen width by half of that for a rectangle
      auto width = x / 2.0;
      auto height = width / 2.0;
      
      //Making the window resizable by aspect ratio and setting size
      AudioProcessorEditor::setResizable(true, true);
      AudioProcessorEditor::setResizeLimits(width * 0.75, height * 0.75, width * 1.25, height * 1.25);
      AudioProcessorEditor::getConstrainer()->setFixedAspectRatio(2.0);
      
      if (audioProcessor.windowWidth != 0.0)
      {
          setSize(audioProcessor.windowWidth, audioProcessor.windowHeight);
      }
          
      else
      {
          setSize (width, height);
      }
      
      constructorFinished = true;
  }
  