CedricGuillemet / ImGuizmo

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

Setting `HatchedAxisLineThickness` to 0 should disable hatched lines #268

Closed peter1745 closed 2 years ago

peter1745 commented 2 years ago

Hello! This is mainly an enhancement that I think should be handled by ImGuizmo. Currently if you set ImGuizmo::Style::HatchedAxisLineThickness to 0 ImGuizmo will still draw the hatched axis lines, although they'll be a lot smaller than normal.

Arguably having the HatchedAxisLineThickness variable be 0 should prevent the hatched axis lines from being rendered in the first place. Since it doesn't make sense for them to show up at all if the thickness is 0.

I've done this locally, and from what I can tell it's just a matter of adding:

if (gContext.mStyle.HatchedAxisLineThickness <= 0.0f)
    return;

to the top of the DrawHatchedAxis function.

Thanks for making and maintaining this library btw! It's really awesome 🙂

CedricGuillemet commented 2 years ago

Sounds like a great addition! Can you please open a PR?

peter1745 commented 2 years ago

Will do!

peter1745 commented 2 years ago

Alright @CedricGuillemet I've create a PR for it now: #269