Skip to content

Commit b9db503

Browse files
committed
Canvas: Minimum supported version is now Dear ImGui 1.89 (August 2022)
1 parent 3bab401 commit b9db503

File tree

3 files changed

+2
-25
lines changed

3 files changed

+2
-25
lines changed

docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ v0.10.0 (WIP):
66

77
BREAKING: Editor: Minimum supported version is now Dear ImGui 1.89 (August 2022)
88

9+
BREAKING: Canvas: Minimum supported version is now Dear ImGui 1.89 (August 2022)
10+
911
RESTRUCTURE:
1012
Removed local copy of all dependencies in favor of auto checkout. This should also reduce
1113
user confusion and attempt to use ancient version of ImGui embedded in the repository.

imgui_canvas.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,8 @@ bool ImGuiEx::Canvas::Begin(ImGuiID id, const ImVec2& size)
108108

109109
UpdateViewTransformPosition();
110110

111-
# if IMGUI_VERSION_NUM > 18415
112111
if (ImGui::IsClippedEx(m_WidgetRect, id))
113112
return false;
114-
# else
115-
if (ImGui::IsClippedEx(m_WidgetRect, id, false))
116-
return false;
117-
# endif
118113

119114
// Save current channel, so we can assert when user
120115
// call canvas API with different one.
@@ -375,13 +370,8 @@ void ImGuiEx::Canvas::SaveViewportState()
375370
m_WindowPosBackup = window->Pos;
376371
m_ViewportPosBackup = viewport->Pos;
377372
m_ViewportSizeBackup = viewport->Size;
378-
# if IMGUI_VERSION_NUM > 18002
379373
m_ViewportWorkPosBackup = viewport->WorkPos;
380374
m_ViewportWorkSizeBackup = viewport->WorkSize;
381-
# else
382-
m_ViewportWorkOffsetMinBackup = viewport->WorkOffsetMin;
383-
m_ViewportWorkOffsetMaxBackup = viewport->WorkOffsetMax;
384-
# endif
385375
# endif
386376
}
387377

@@ -394,13 +384,8 @@ void ImGuiEx::Canvas::RestoreViewportState()
394384
window->Pos = m_WindowPosBackup;
395385
viewport->Pos = m_ViewportPosBackup;
396386
viewport->Size = m_ViewportSizeBackup;
397-
# if IMGUI_VERSION_NUM > 18002
398387
viewport->WorkPos = m_ViewportWorkPosBackup;
399388
viewport->WorkSize = m_ViewportWorkSizeBackup;
400-
# else
401-
viewport->WorkOffsetMin = m_ViewportWorkOffsetMinBackup;
402-
viewport->WorkOffsetMax = m_ViewportWorkOffsetMaxBackup;
403-
# endif
404389
# endif
405390
}
406391

@@ -463,13 +448,8 @@ void ImGuiEx::Canvas::EnterLocalSpace()
463448
viewport->Pos = viewport_min;
464449
viewport->Size = viewport_max - viewport_min;
465450

466-
# if IMGUI_VERSION_NUM > 18002
467451
viewport->WorkPos = m_ViewportWorkPosBackup * m_View.InvScale;
468452
viewport->WorkSize = m_ViewportWorkSizeBackup * m_View.InvScale;
469-
# else
470-
viewport->WorkOffsetMin = m_ViewportWorkOffsetMinBackup * m_View.InvScale;
471-
viewport->WorkOffsetMax = m_ViewportWorkOffsetMaxBackup * m_View.InvScale;
472-
# endif
473453
# endif
474454

475455
// Clip rectangle in parent canvas space and move it to local space.

imgui_canvas.h

-5
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,8 @@ struct Canvas
258258
ImVec2 m_WindowPosBackup;
259259
ImVec2 m_ViewportPosBackup;
260260
ImVec2 m_ViewportSizeBackup;
261-
# if IMGUI_VERSION_NUM > 18002
262261
ImVec2 m_ViewportWorkPosBackup;
263262
ImVec2 m_ViewportWorkSizeBackup;
264-
# else
265-
ImVec2 m_ViewportWorkOffsetMinBackup;
266-
ImVec2 m_ViewportWorkOffsetMaxBackup;
267-
# endif
268263
# endif
269264
};
270265

0 commit comments

Comments
 (0)