Skip to content

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

@chenghongyao

Description

@chenghongyao

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions