|
@@ -235,7 +235,6 @@
|
235
|
235
|
==================
|
236
|
236
|
|
237
|
237
|
- misc: merge or clarify ImVec4 / ImGuiAabb, they are essentially duplicate containers
|
238
|
|
-!- i/o: avoid requesting mouse capture if button held and initial click was out of reach for imgui
|
239
|
238
|
- window: add horizontal scroll
|
240
|
239
|
- window: fix resize grip rendering scaling along with Rounding style setting
|
241
|
240
|
- window: autofit feedback loop when user relies on any dynamic layout (window width multiplier, column). maybe just clearly drop manual autofit?
|
|
@@ -257,6 +256,7 @@
|
257
|
256
|
- input number: use mouse wheel to step up/down
|
258
|
257
|
- input number: non-decimal input.
|
259
|
258
|
- layout: horizontal layout helper (github issue #97)
|
|
259
|
+ - layout: more generic alignment state (left/right/centered) for single items?
|
260
|
260
|
- layout: clean up the InputFloatN/SliderFloatN/ColorEdit4 layout code. item width should include frame padding.
|
261
|
261
|
- columns: separator function or parameter that works within the column (currently Separator() bypass all columns)
|
262
|
262
|
- columns: declare column set (each column: fixed size, %, fill, distribute default size among fills)
|
|
@@ -300,6 +300,7 @@
|
300
|
300
|
- misc: mark printf compiler attributes on relevant functions
|
301
|
301
|
- misc: provide a way to compile out the entire implementation while providing a dummy API (e.g. #define IMGUI_DUMMY_IMPL)
|
302
|
302
|
- misc: double-clicking on title bar to minimize isn't consistent, perhaps move to single-click on left-most collapse icon?
|
|
303
|
+ - style editor: have a more global HSV setter (e.g. alter hue on all elements). consider replacing active/hovered by offset in HSV space?
|
303
|
304
|
- style editor: color child window height expressed in multiple of line height.
|
304
|
305
|
- optimization/render: use indexed rendering to reduce vertex data cost (for remote/networked imgui)
|
305
|
306
|
- optimization/render: move clip-rect to vertex data? would allow merging all commands
|
|
@@ -1059,7 +1060,7 @@ struct ImGuiWindow
|
1059
|
1060
|
|
1060
|
1061
|
ImGuiDrawContext DC;
|
1061
|
1062
|
ImVector<ImGuiID> IDStack;
|
1062
|
|
- ImVector<ImVec4> ClipRectStack;
|
|
1063
|
+ ImVector<ImVec4> ClipRectStack; // Scissoring / clipping rectangle. x1, y1, x2, y2.
|
1063
|
1064
|
int LastFrameDrawn;
|
1064
|
1065
|
float ItemWidthDefault;
|
1065
|
1066
|
ImGuiStorage StateStorage;
|
|
@@ -1697,10 +1698,25 @@ void ImGui::NewFrame()
|
1697
|
1698
|
else
|
1698
|
1699
|
g.HoveredRootWindow = FindHoveredWindow(g.IO.MousePos, true);
|
1699
|
1700
|
|
1700
|
|
- // Are we using inputs? Tell user so they can capture/discard them.
|
1701
|
|
- g.IO.WantCaptureMouse = (g.HoveredWindow != NULL) || (g.ActiveId != 0);
|
|
1701
|
+ // Are we using inputs? Tell user so they can capture/discard the inputs away from the rest of their application.
|
|
1702
|
+ // When clicking outside of a window we assume the click is owned by the application and won't request capture.
|
|
1703
|
+ int mouse_earliest_button_down = -1;
|
|
1704
|
+ for (size_t i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
|
|
1705
|
+ {
|
|
1706
|
+ if (g.IO.MouseClicked[i])
|
|
1707
|
+ g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL);
|
|
1708
|
+ if (g.IO.MouseDown[i])
|
|
1709
|
+ if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[mouse_earliest_button_down] > g.IO.MouseClickedTime[i])
|
|
1710
|
+ mouse_earliest_button_down = i;
|
|
1711
|
+ }
|
|
1712
|
+ bool mouse_owned_by_application = mouse_earliest_button_down != -1 && !g.IO.MouseDownOwned[mouse_earliest_button_down];
|
|
1713
|
+ g.IO.WantCaptureMouse = (!mouse_owned_by_application && g.HoveredWindow != NULL) || (g.ActiveId != 0);
|
1702
|
1714
|
g.IO.WantCaptureKeyboard = (g.ActiveId != 0);
|
1703
|
1715
|
|
|
1716
|
+ // If mouse was first clicked outside of ImGui bounds we also cancel out hovering.
|
|
1717
|
+ if (mouse_owned_by_application)
|
|
1718
|
+ g.HoveredWindow = g.HoveredRootWindow = NULL;
|
|
1719
|
+
|
1704
|
1720
|
// Scale & Scrolling
|
1705
|
1721
|
if (g.HoveredWindow && g.IO.MouseWheel != 0.0f)
|
1706
|
1722
|
{
|
|
@@ -1830,7 +1846,7 @@ static void PushClipRect(const ImVec4& clip_rect, bool clipped = true)
|
1830
|
1846
|
ImVec4 cr = clip_rect;
|
1831
|
1847
|
if (clipped && !window->ClipRectStack.empty())
|
1832
|
1848
|
{
|
1833
|
|
- // Clip to new clip rect
|
|
1849
|
+ // Clip with existing clip rect
|
1834
|
1850
|
const ImVec4 cur_cr = window->ClipRectStack.back();
|
1835
|
1851
|
cr = ImVec4(ImMax(cr.x, cur_cr.x), ImMax(cr.y, cur_cr.y), ImMin(cr.z, cur_cr.z), ImMin(cr.w, cur_cr.w));
|
1836
|
1852
|
}
|
|
@@ -2815,7 +2831,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
|
2815
|
2831
|
|
2816
|
2832
|
const ImVec2 text_size = CalcTextSize(name, NULL, true);
|
2817
|
2833
|
const ImVec2 text_max = window->Pos + ImVec2(window->Size.x - (p_opened ? (title_bar_aabb.GetHeight()-3) : style.FramePadding.x), style.FramePadding.y + text_size.y);
|
2818
|
|
- const bool clip_title = text_size.x > (text_max.x - text_min.x); // only push a clip rectangle if we need to, because it may turn into a separate draw call
|
|
2834
|
+ const bool clip_title = text_size.x > (text_max.x - text_min.x); // only push a clip rectangle if we need to, because it may turn into a separate draw call // FIXME-OPT: CPU side clipping would work well for this kind of case.
|
2819
|
2835
|
if (clip_title)
|
2820
|
2836
|
PushClipRect(ImVec4(text_min.x, text_min.y, text_max.x, text_max.y));
|
2821
|
2837
|
RenderText(text_min, name);
|
|
@@ -6154,6 +6170,7 @@ void ImDrawList::UpdateClipRect()
|
6154
|
6170
|
}
|
6155
|
6171
|
}
|
6156
|
6172
|
|
|
6173
|
+// Scissoring. The values in clip_rect are x1, y1, x2, y2.
|
6157
|
6174
|
void ImDrawList::PushClipRect(const ImVec4& clip_rect)
|
6158
|
6175
|
{
|
6159
|
6176
|
clip_rect_stack.push_back(clip_rect);
|
|
@@ -7712,6 +7729,8 @@ void ImGui::ShowTestWindow(bool* opened)
|
7712
|
7729
|
ImGui::Text("ImGui says hello.");
|
7713
|
7730
|
//ImGui::Text("MousePos (%g, %g)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
|
7714
|
7731
|
//ImGui::Text("MouseWheel %d", ImGui::GetIO().MouseWheel);
|
|
7732
|
+ //ImGui::Text("WantCaptureMouse: %d", ImGui::GetIO().WantCaptureMouse);
|
|
7733
|
+ //ImGui::Text("WantCaptureKeyboard: %d", ImGui::GetIO().WantCaptureKeyboard);
|
7715
|
7734
|
|
7716
|
7735
|
ImGui::Spacing();
|
7717
|
7736
|
if (ImGui::CollapsingHeader("Help"))
|