Sample preview has maximum y height relative to x

This commit is contained in:
BlastBrothers 2022-04-08 10:23:51 -04:00
parent 7850e892d5
commit 1151db5091
1 changed files with 7 additions and 1 deletions

View File

@ -554,8 +554,14 @@ void FurnaceGUI::drawSampleEdit() {
ImGui::Separator();
ImVec2 avail=ImGui::GetContentRegionAvail();
ImVec2 avail=ImGui::GetContentRegionAvail(); // graph size determined here
if (ImGui::GetContentRegionAvail().y > (ImGui::GetContentRegionAvail().x / 2.0f)) {
avail=ImVec2(ImGui::GetContentRegionAvail().x,ImGui::GetContentRegionAvail().x / 2.0f);
}
avail.y-=ImGui::GetFontSize()+ImGui::GetStyle().ItemSpacing.y+ImGui::GetStyle().ScrollbarSize;
if (avail.y < 1.0){ //Prevents crash
avail.y = 1.0;
}
int availX=avail.x;
int availY=avail.y;