GUI: short circuit evaluation paranoia

issue #2327
This commit is contained in:
tildearrow 2025-01-17 03:01:30 -05:00
parent cfcad1e689
commit 304a8b8722

View file

@ -71,15 +71,18 @@ const char* sampleNote[12]={
}
#define SIMPLE_DRAG_SOURCE(_c,_toMoveVar) \
if (settings.draggableDataView && ImGui::BeginDragDropSource()) { \
if (settings.draggableDataView) { \
if (ImGui::BeginDragDropSource()) { \
_toMoveVar=i; \
ImGui::SetDragDropPayload(_c,NULL,0,ImGuiCond_Once); \
ImGui::Button(ICON_FA_ARROWS "##AssetDrag"); \
ImGui::EndDragDropSource(); \
} \
}
#define SIMPLE_DRAG_TARGET(_c,_toMoveVar,_curVar,_swapFn,_moveUpFn,_moveDownFn) \
if (settings.draggableDataView && ImGui::BeginDragDropTarget()) { \
if (settings.draggableDataView) { \
if (ImGui::BeginDragDropTarget()) { \
const ImGuiPayload* payload=ImGui::AcceptDragDropPayload(_c); \
if (payload!=NULL) { \
int target=i; \
@ -113,6 +116,7 @@ const char* sampleNote[12]={
_toMoveVar=-1; \
ImGui::EndDragDropTarget(); \
} \
} \
}
void FurnaceGUI::insListItem(int i, int dir, int asset) {