Skip to content

Commit c3811a3

Browse files
committed
FIX getObjectId() was not working
- objectId lost - mouse button handling broken
1 parent 890658b commit c3811a3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/editor/tool/node/NodeTool.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,6 @@ namespace editor
483483
inputState.mouseLeft == GLFW_PRESS &&
484484
ctx.getInput().allowMouse())
485485
{
486-
m_state.m_wasMouseLeft = inputState.mouseLeft;
487-
488486
if (inputState.ctrl)
489487
{
490488
handleSelectNode(ctx);
@@ -494,9 +492,8 @@ namespace editor
494492
// shoot(ctx, scene, input, inputState);
495493
//}
496494
}
497-
else {
498-
m_state.m_wasMouseLeft = false;
499-
}
495+
496+
m_state.m_wasMouseLeft = inputState.mouseLeft;
500497
}
501498

502499
void NodeTool::handleSelectNode(

src/engine/BaseContext.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,12 @@ render::RenderContext BaseContext::toRenderContext() const
9090
size.y,
9191
debug::DebugContext::get()
9292
};
93+
{
94+
// TODO KI layer needed for getObjectId()
95+
// => but doing this here globally is bad
96+
const auto* layer = LayerInfo::findLayer(LAYER_MAIN);
97+
//if (!layer || !layer->m_enabled) return;
98+
ctx.m_layer = layer->m_index;
99+
}
93100
return ctx;
94101
}

0 commit comments

Comments
 (0)