17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-28 20:27:28 +01:00

feat(ui): imgui 1.91.9b-docking in place of 1.73: local changes of the backends carried over (glad as the gl loader, srgb and gamma of the ui, gles glsl string), BufferingBar/Spinner kept, imgui_tables in cmake; cursor position, cursor enter and focus of the main window passed to the glfw backend, which works with events now; code adapted to the api: ImGuiListClipper::Begin, BeginListBox, ImTextureID as an integer, ImageButton with an id, ImGuiKey without GetKeyIndex, logarithmic sliders in place of the removed power argument; ImGuizmo with the math operators defined before imgui.h and SetNextFrameWantCaptureMouse

This commit is contained in:
2026-10-08 20:38:13 +02:00
parent e661b9f1c7
commit 344034ec70
40 changed files with 48540 additions and 14321 deletions

View File

@@ -24,10 +24,11 @@
// SOFTWARE.
//
#include "imgui.h"
// imgui 1.86+ wants the operators requested before the first include of imgui.h
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
#include "imgui.h"
#include "imgui_internal.h"
#include "ImGuizmo.h"
@@ -1883,7 +1884,7 @@ namespace ImGuizmo
// move
if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsTranslateType(gContext.mCurrentOperation))
{
ImGui::CaptureMouseFromApp();
ImGui::SetNextFrameWantCaptureMouse(true);
const float len = fabsf(IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mTranslationPlan)); // near plan
vec_t newPos = gContext.mRayOrigin + gContext.mRayVector * len;
@@ -1953,7 +1954,7 @@ namespace ImGuizmo
type = GetMoveType(op, &gizmoHitProportion);
if (type != MT_NONE)
{
ImGui::CaptureMouseFromApp();
ImGui::SetNextFrameWantCaptureMouse(true);
}
if (CanActivate() && type != MT_NONE)
{
@@ -1998,7 +1999,7 @@ namespace ImGuizmo
type = GetScaleType(op);
if (type != MT_NONE)
{
ImGui::CaptureMouseFromApp();
ImGui::SetNextFrameWantCaptureMouse(true);
}
if (CanActivate() && type != MT_NONE)
{
@@ -2021,7 +2022,7 @@ namespace ImGuizmo
// scale
if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsScaleType(gContext.mCurrentOperation))
{
ImGui::CaptureMouseFromApp();
ImGui::SetNextFrameWantCaptureMouse(true);
const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mTranslationPlan);
vec_t newPos = gContext.mRayOrigin + gContext.mRayVector * len;
vec_t newOrigin = newPos - gContext.mRelativeOrigin * gContext.mScreenFactor;
@@ -2112,7 +2113,7 @@ namespace ImGuizmo
if (type != MT_NONE)
{
ImGui::CaptureMouseFromApp();
ImGui::SetNextFrameWantCaptureMouse(true);
}
if (type == MT_ROTATE_SCREEN)
@@ -2146,7 +2147,7 @@ namespace ImGuizmo
// rotation
if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsRotateType(gContext.mCurrentOperation))
{
ImGui::CaptureMouseFromApp();
ImGui::SetNextFrameWantCaptureMouse(true);
gContext.mRotationAngle = ComputeAngleOnPlan();
if (snap)
{