Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjfs committed Jan 15, 2020
1 parent fb9c453 commit 5cd803f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 3 additions & 1 deletion Example/Source/Tools.inl
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ protected:
InputPosition2D _input { 0, 0 };
};


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


void record_tool(const ToolContext& tool, int time) {
Expand Down
25 changes: 12 additions & 13 deletions Example/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,19 +585,18 @@ void Application::drawScene() {
}
});

// Registry.view<Position, Sequentity::Track, Color>().each([&](const auto& position,
// const auto& track,
// const auto& color) {
// Sequentity::Intersect(track, sqty.current_time, [&](auto& event) {
// if (event.type == TranslateEvent) {
// auto data = static_cast<ToolEventData*>(event.data);
// auto input = data->input[data->start];
// Position pos = position + (input.absolute - data->origin);
// auto impos = ImVec2(Vector2(Vector2i(pos.x, pos.y)));
// Widgets::Cursor(impos, color);
// }
// });
// });
Sequentity::Intersect(Events, sqty.current_time, [&](entt::entity subject, entt::entity event_entity) {
auto& event = Events.get<Sequentity::Event>(event_entity);
auto& position = Registry.get<Position>(subject);

if (event.type == TranslateEvent) {
auto data = static_cast<ToolEventData*>(event.data);
auto input = data->input[data->start];
Position pos = position + (input.absolute - data->origin);
auto impos = ImVec2(Vector2(Vector2i(pos.x, pos.y)));
Widgets::Cursor(impos, ImColor{1.0f, 1.0f, 1.0f});
}
});
}

ImGui::End();
Expand Down

0 comments on commit 5cd803f

Please sign in to comment.