Skip to content

Prevent window collision when moving #8483

@TheMode

Description

@TheMode

Version/Branch of Dear ImGui:

master

Back-ends:

SDL3 + SDL_GPU

Compiler, OS:

Windows 11 MSVC

Full config/build information:

No response

Details:

I am making an infinite canvas application, and I wish to have ImGui windows over it, with the ability to be moved/resized and follow the camera.

I got it somewhat working with this simple solution (please tell me if there is a better way)

const ImVec2 camera_delta = app->camera - app->camera_prev;
...
if (camera_moved) {
  ImGui::SetWindowPos(ImGui::GetWindowPos()-camera_delta);
}

(Got the idea from #1604)

One problem however, seems that the window does not want to go out of view, which seem fair as a default since you do not want to lose track of it, but in my case it is mostly a nuisance.

Screenshots/Video:

ezyZip.mp4

Minimal, Complete and Verifiable Example code:

No response

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