GUI: fix more issues
- macro range is now 128 (it was 127 before) - fix #407
This commit is contained in:
parent
99b5afd4da
commit
44f1134875
|
@ -1750,8 +1750,11 @@ void FurnaceGUI::processDrags(int dragX, int dragY) {
|
||||||
if (macroLoopDragLen>0) {
|
if (macroLoopDragLen>0) {
|
||||||
int x=(dragX-macroLoopDragStart.x)*macroLoopDragLen/MAX(1,macroLoopDragAreaSize.x);
|
int x=(dragX-macroLoopDragStart.x)*macroLoopDragLen/MAX(1,macroLoopDragAreaSize.x);
|
||||||
if (x<0) x=0;
|
if (x<0) x=0;
|
||||||
if (x>=macroLoopDragLen) x=-1;
|
if (x>=macroLoopDragLen) {
|
||||||
|
x=-1;
|
||||||
|
} else {
|
||||||
x+=macroDragScroll;
|
x+=macroDragScroll;
|
||||||
|
}
|
||||||
*macroLoopDragTarget=x;
|
*macroLoopDragTarget=x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2417,6 +2420,13 @@ bool FurnaceGUI::loop() {
|
||||||
|
|
||||||
wantCaptureKeyboard=ImGui::GetIO().WantTextInput;
|
wantCaptureKeyboard=ImGui::GetIO().WantTextInput;
|
||||||
|
|
||||||
|
if (wantCaptureKeyboard) {
|
||||||
|
WAKE_UP;
|
||||||
|
}
|
||||||
|
if (ImGui::GetIO().MouseDown[0] || ImGui::GetIO().MouseDown[1] || ImGui::GetIO().MouseDown[2] || ImGui::GetIO().MouseDown[3] || ImGui::GetIO().MouseDown[4]) {
|
||||||
|
WAKE_UP;
|
||||||
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
midiLock.lock();
|
midiLock.lock();
|
||||||
if (midiQueue.empty()) {
|
if (midiQueue.empty()) {
|
||||||
|
|
|
@ -1078,7 +1078,7 @@ void FurnaceGUI::drawGBEnv(unsigned char vol, unsigned char len, unsigned char s
|
||||||
if (displayLoop) { \
|
if (displayLoop) { \
|
||||||
ImGui::SetNextItemWidth(lenAvail); \
|
ImGui::SetNextItemWidth(lenAvail); \
|
||||||
if (ImGui::InputScalar("##IMacroLen_" macroName,ImGuiDataType_U8,¯o.len,&_ONE,&_THREE)) { MARK_MODIFIED \
|
if (ImGui::InputScalar("##IMacroLen_" macroName,ImGuiDataType_U8,¯o.len,&_ONE,&_THREE)) { MARK_MODIFIED \
|
||||||
if (macro.len>127) macro.len=127; \
|
if (macro.len>128) macro.len=128; \
|
||||||
} \
|
} \
|
||||||
if (macroMode) { \
|
if (macroMode) { \
|
||||||
bool modeVal=macro.mode; \
|
bool modeVal=macro.mode; \
|
||||||
|
@ -1178,7 +1178,7 @@ void FurnaceGUI::drawGBEnv(unsigned char vol, unsigned char len, unsigned char s
|
||||||
if (displayLoop) { \
|
if (displayLoop) { \
|
||||||
ImGui::SetNextItemWidth(lenAvail); \
|
ImGui::SetNextItemWidth(lenAvail); \
|
||||||
if (ImGui::InputScalar("##IOPMacroLen_" #op macroName,ImGuiDataType_U8,¯o.len,&_ONE,&_THREE)) { MARK_MODIFIED \
|
if (ImGui::InputScalar("##IOPMacroLen_" #op macroName,ImGuiDataType_U8,¯o.len,&_ONE,&_THREE)) { MARK_MODIFIED \
|
||||||
if (macro.len>127) macro.len=127; \
|
if (macro.len>128) macro.len=128; \
|
||||||
} \
|
} \
|
||||||
if (macroMode) { \
|
if (macroMode) { \
|
||||||
bool modeVal=macro.mode; \
|
bool modeVal=macro.mode; \
|
||||||
|
@ -1267,14 +1267,14 @@ if (ImGui::BeginTable("MacroSpace",2)) { \
|
||||||
ImGui::Dummy(ImVec2(120.0f*dpiScale,dpiScale)); \
|
ImGui::Dummy(ImVec2(120.0f*dpiScale,dpiScale)); \
|
||||||
ImGui::TableNextColumn(); \
|
ImGui::TableNextColumn(); \
|
||||||
float availableWidth=ImGui::GetContentRegionAvail().x-reservedSpace; \
|
float availableWidth=ImGui::GetContentRegionAvail().x-reservedSpace; \
|
||||||
int totalFit=MIN(127,availableWidth/MAX(1,macroPointSize*dpiScale)); \
|
int totalFit=MIN(128,availableWidth/MAX(1,macroPointSize*dpiScale)); \
|
||||||
if (macroDragScroll>127-totalFit) { \
|
if (macroDragScroll>128-totalFit) { \
|
||||||
macroDragScroll=127-totalFit; \
|
macroDragScroll=128-totalFit; \
|
||||||
} \
|
} \
|
||||||
ImGui::SetNextItemWidth(availableWidth); \
|
ImGui::SetNextItemWidth(availableWidth); \
|
||||||
if (CWSliderInt("##MacroScroll",¯oDragScroll,0,127-totalFit,"")) { \
|
if (CWSliderInt("##MacroScroll",¯oDragScroll,0,128-totalFit,"")) { \
|
||||||
if (macroDragScroll<0) macroDragScroll=0; \
|
if (macroDragScroll<0) macroDragScroll=0; \
|
||||||
if (macroDragScroll>127-totalFit) macroDragScroll=127-totalFit; \
|
if (macroDragScroll>128-totalFit) macroDragScroll=128-totalFit; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MACRO_END \
|
#define MACRO_END \
|
||||||
|
@ -1282,9 +1282,9 @@ if (ImGui::BeginTable("MacroSpace",2)) { \
|
||||||
ImGui::TableNextColumn(); \
|
ImGui::TableNextColumn(); \
|
||||||
ImGui::TableNextColumn(); \
|
ImGui::TableNextColumn(); \
|
||||||
ImGui::SetNextItemWidth(availableWidth); \
|
ImGui::SetNextItemWidth(availableWidth); \
|
||||||
if (CWSliderInt("##MacroScroll",¯oDragScroll,0,127-totalFit,"")) { \
|
if (CWSliderInt("##MacroScroll",¯oDragScroll,0,128-totalFit,"")) { \
|
||||||
if (macroDragScroll<0) macroDragScroll=0; \
|
if (macroDragScroll<0) macroDragScroll=0; \
|
||||||
if (macroDragScroll>127-totalFit) macroDragScroll=127-totalFit; \
|
if (macroDragScroll>128-totalFit) macroDragScroll=128-totalFit; \
|
||||||
} \
|
} \
|
||||||
ImGui::EndTable(); \
|
ImGui::EndTable(); \
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue