mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-26 22:43:01 +00:00
GUi: yay finally edge scroll in sample editor!
This commit is contained in:
parent
e21040169f
commit
b289ac97fc
1 changed files with 22 additions and 0 deletions
|
@ -881,6 +881,28 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::IsItemActive()) {
|
||||||
|
logV("item is active...");
|
||||||
|
if (ImGui::GetMousePos().x>rectMax.x) {
|
||||||
|
double delta=pow(MAX(1.0,(ImGui::GetMousePos().x-rectMax.x)*0.04),2.0);
|
||||||
|
samplePos+=MAX(1.0,sampleZoom*delta);
|
||||||
|
int bounds=((int)sample->samples-round(avail.x*sampleZoom));
|
||||||
|
if (bounds<0) bounds=0;
|
||||||
|
if (samplePos>bounds) samplePos=bounds;
|
||||||
|
updateSampleTex=true;
|
||||||
|
processDrags(ImGui::GetMousePos().x,ImGui::GetMousePos().y);
|
||||||
|
WAKE_UP;
|
||||||
|
}
|
||||||
|
if (ImGui::GetMousePos().x<rectMin.x) {
|
||||||
|
double delta=pow(MAX(1.0,(rectMin.x-ImGui::GetMousePos().x)*0.04),2.0);
|
||||||
|
samplePos-=MAX(1.0,sampleZoom*delta);
|
||||||
|
if (samplePos<0) samplePos=0;
|
||||||
|
updateSampleTex=true;
|
||||||
|
processDrags(ImGui::GetMousePos().x,ImGui::GetMousePos().y);
|
||||||
|
WAKE_UP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!sampleDragMode && ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
|
if (!sampleDragMode && ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
|
||||||
ImGui::OpenPopup("SRightClick");
|
ImGui::OpenPopup("SRightClick");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue