Skip to content

Commit 5cd803f

Browse files
committed
Cosmetics
1 parent fb9c453 commit 5cd803f

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

Example/Source/Tools.inl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,10 @@ protected:
166166
InputPosition2D _input { 0, 0 };
167167
};
168168

169+
170+
// TODO: Recording is called at different times for the same tool
171+
// and need to pass the event amongst themselves. This is ugly.
169172
static entt::entity ACTIVE_EVENT { entt::null };
170-
static entt::entity ACTIVE_TRACK { entt::null };
171173

172174

173175
void record_tool(const ToolContext& tool, int time) {

Example/Source/main.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -585,19 +585,18 @@ void Application::drawScene() {
585585
}
586586
});
587587

588-
// Registry.view<Position, Sequentity::Track, Color>().each([&](const auto& position,
589-
// const auto& track,
590-
// const auto& color) {
591-
// Sequentity::Intersect(track, sqty.current_time, [&](auto& event) {
592-
// if (event.type == TranslateEvent) {
593-
// auto data = static_cast<ToolEventData*>(event.data);
594-
// auto input = data->input[data->start];
595-
// Position pos = position + (input.absolute - data->origin);
596-
// auto impos = ImVec2(Vector2(Vector2i(pos.x, pos.y)));
597-
// Widgets::Cursor(impos, color);
598-
// }
599-
// });
600-
// });
588+
Sequentity::Intersect(Events, sqty.current_time, [&](entt::entity subject, entt::entity event_entity) {
589+
auto& event = Events.get<Sequentity::Event>(event_entity);
590+
auto& position = Registry.get<Position>(subject);
591+
592+
if (event.type == TranslateEvent) {
593+
auto data = static_cast<ToolEventData*>(event.data);
594+
auto input = data->input[data->start];
595+
Position pos = position + (input.absolute - data->origin);
596+
auto impos = ImVec2(Vector2(Vector2i(pos.x, pos.y)));
597+
Widgets::Cursor(impos, ImColor{1.0f, 1.0f, 1.0f});
598+
}
599+
});
601600
}
602601

603602
ImGui::End();

0 commit comments

Comments
 (0)