Skip to content

Commit 962aa4c

Browse files
committed
DragFloat() double-clicking turns into an input box (along with Ctrl+clicking) #180
1 parent 916a895 commit 962aa4c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

imgui.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -5512,14 +5512,13 @@ bool ImGui::DragFloat(const char* label, float *v, float v_step, float v_min, fl
55125512
// Tabbing or CTRL-clicking on Drag turns it into an input box
55135513
bool start_text_input = false;
55145514
const bool tab_focus_requested = window->FocusItemRegister(g.ActiveId == id);
5515-
if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]))
5515+
if (tab_focus_requested || (hovered && (g.IO.MouseClicked[0] | g.IO.MouseDoubleClicked[0])))
55165516
{
55175517
SetActiveId(id);
55185518
FocusWindow(window);
55195519
g.DragLastMouseDelta = ImVec2(0.f, 0.f);
55205520

5521-
const bool is_ctrl_down = g.IO.KeyCtrl;
5522-
if (tab_focus_requested || is_ctrl_down)
5521+
if (tab_focus_requested || g.IO.KeyCtrl || g.IO.MouseDoubleClicked[0])
55235522
{
55245523
start_text_input = true;
55255524
g.ScalarAsInputTextId = 0;

0 commit comments

Comments
 (0)