CedricGuillemet / ImGuizmo

Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui
MIT License
3.14k stars 883 forks source link

Fixed EditTransform drawing [gizmo count] times in example/main.cpp #331

Closed GiovanyH closed 1 month ago

GiovanyH commented 1 month ago

The current implementation in example/main.cpp calls the EditTransform function [gizmo count] times, to draw the gizmo on multiple objects. However, this approach also results in the grid, cubes, and view manipulation being drawn multiple times, which is redundant and inefficient.

The EditTransform function is intended to draw only the gizmo, as indicated in the Readme.md. However, in its current state, it also includes the drawing of the grid, cubes, and view manipulation.

I have refactored the code by separating the concerns within the EditTransform function. I separated them into 2 functions, so that we only draw the rest once, and draw the gizmo on each object.