Open coz-eduardo-hernandez opened 9 months ago
Might be related to https://github.com/hoffstadt/DearPyGui/issues/1550
@v-ein wrote on Discord:
It does indeed subtract title bar height unconditionally:
if (IsItemFocused(item.state)) { float titleBarHeight = ImGui::GetStyle().FramePadding.y * 2 + ImGui::GetFontSize(); // update mouse ImVec2 mousePos = ImGui::GetMousePos(); float x = mousePos.x - ImGui::GetWindowPos().x; float y = mousePos.y - ImGui::GetWindowPos().y - titleBarHeight; GContext->input.mousePos.x = (int)x; GContext->input.mousePos.y = (int)y;
So we need an extra "if" around titleBarHeight (or a ?:).
Version of Dear PyGui
Version: 1.10 Operating System: Windows 10
My Issue/Question
get_mouse_pos() value turns negative when going where into the title bar area, which makes sense when there's a title bar, but when where's none either explicitly or by assigning a primary window the same calculations are given A clear and concise description of what the issue/question is. Please provide as much context as possible.
To Reproduce
Expected behavior
Get coordinates relative to 0,0 in the window
Standalone, minimal, complete and verifiable example