mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
Sample preview has maximum y height relative to x
This commit is contained in:
parent
7850e892d5
commit
1151db5091
1 changed files with 7 additions and 1 deletions
|
@ -554,8 +554,14 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
|
|
||||||
ImGui::Separator();
|
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;
|
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 availX=avail.x;
|
||||||
int availY=avail.y;
|
int availY=avail.y;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue