GUI: save per-chan osc state

This commit is contained in:
tildearrow 2022-06-23 04:02:41 -05:00
parent abbd6e7274
commit 1b5396e814
4 changed files with 50 additions and 5 deletions

View file

@ -143,11 +143,13 @@ void FurnaceGUI::drawChanOsc() {
ImGui::Image(chanOscGradTex,gradSize);
ImVec2 gradLeftAbs=ImGui::GetItemRectMin();
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
chanOscGrad.points.push_back(Gradient2DPoint(
(ImGui::GetMousePos().x-gradLeftAbs.x)/gradSize.x,
(ImGui::GetMousePos().y-gradLeftAbs.y)/gradSize.y
));
updateChanOscGradTex=true;
if (chanOscGrad.points.size()<32) {
chanOscGrad.points.push_back(Gradient2DPoint(
(ImGui::GetMousePos().x-gradLeftAbs.x)/gradSize.x,
(ImGui::GetMousePos().y-gradLeftAbs.y)/gradSize.y
));
updateChanOscGradTex=true;
}
}
ImVec2 oldCurPos=ImGui::GetCursorPos();