Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The mouse coordinates passed to VTK are incorrect for docker branch #20

Open
chenghongyao opened this issue Mar 13, 2024 · 1 comment
Open

Comments

@chenghongyao
Copy link

as the title say, check the code

	ImGuiIO& io = ImGui::GetIO(); (void)io;
	io.ConfigWindowsMoveFromTitleBarOnly = true; // don't drag window when clicking on image.
	ImVec2 viewportPos = ImGui::GetCursorStartPos();

	double xpos = static_cast<double>(io.MousePos[0]) - static_cast<double>(viewportPos.x);
	double ypos = static_cast<double>(io.MousePos[1]) - static_cast<double>(viewportPos.y);

and it cause some issue when using vtkPointPicker, i use this code instead, and everything seems fine

	ImGuiIO& io = ImGui::GetIO(); (void)io;
	io.ConfigWindowsMoveFromTitleBarOnly = true; // don't drag window when clicking on image.
	ImVec2 viewportPos = ImGui::GetCursorStartPos();
        ImVec2 winPos = ImGui::GetWindowPos();

	double xpos = static_cast<double>(io.MousePos[0])  - winPos.x - static_cast<double>(viewportPos.x);
	double ypos = static_cast<double>(io.MousePos[1])  - winPos.y - static_cast<double>(viewportPos.y);
@rajkundu
Copy link
Collaborator

This seems very possible, but we should also look at how to integrate this fix into PR #19 as well. I unfortunately can't work on this easily for a little while but will try to whenever I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants