Git Product home page Git Product logo

Comments (5)

GamingMinds-DanielC avatar GamingMinds-DanielC commented on July 16, 2024 2

Looks like a problem with scissor rects not being set up correctly. Have you modified the render backend in any way or do you use an outdated one by accident? Do you use draw list callbacks that could mess up the render state?

from imgui.

ocornut avatar ocornut commented on July 16, 2024

There's a possibility this is affected by the different resolution between render target and window size on a Mac with Retina display, but since the provided screenshot appears to be near the top-left of window it may not be this. See if things look different on all 4 corners of the window.

We do this in ImGui_ImplOpenGL3_RenderDrawData():

    // Will project scissor/clipping rectangles into framebuffer space
    ImVec2 clip_off = draw_data->DisplayPos;         // (0,0) unless using multi-viewports
    ImVec2 clip_scale = draw_data->FramebufferScale; // (1,1) unless using retina display which are often (2,2)
                // Project scissor/clipping rectangles into framebuffer space
                ImVec2 clip_min((pcmd->ClipRect.x - clip_off.x) * clip_scale.x, (pcmd->ClipRect.y - clip_off.y) * clip_scale.y);
                ImVec2 clip_max((pcmd->ClipRect.z - clip_off.x) * clip_scale.x, (pcmd->ClipRect.w - clip_off.y) * clip_scale.y);
                if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
                    continue;

                // Apply scissor/clipping rectangle (Y is inverted in OpenGL)
                GL_CALL(glScissor((int)clip_min.x, (int)((float)fb_height - clip_max.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y)));

Can you verify the value of draw_data->FramebufferScale ?
Normally ImGui_ImplGlfw_NewFrame() does:

// Setup display size (every frame to accommodate for window resizing)
int w, h;
int display_w, display_h;
glfwGetWindowSize(bd->Window, &w, &h);
glfwGetFramebufferSize(bd->Window, &display_w, &display_h);
io.DisplaySize = ImVec2((float)w, (float)h);
if (w > 0 && h > 0)
    io.DisplayFramebufferScale = ImVec2((float)display_w / (float)w, (float)display_h / (float)h);

And on a Mac this should set io.DisplayFramebufferScale to (2,2) or (3,3).
Try to adjust that value and see if it makes a difference too.

from imgui.

ocornut avatar ocornut commented on July 16, 2024

It may be also good to clarify if this ONLY happens on docked window border as you stated (vs also happening e.g. on any window will scrollable contents). If it does ONLY happens on docked windows as you stated, it may be another cause.

Please also open Tools->Metrics/Debugger->Viewports->Monitors and report the contents displayed there.

from imgui.

hsm4 avatar hsm4 commented on July 16, 2024

Thanks a lot for the quick answers. I forgot to mention that you can try it out in the browser in our WebAssembly-Emscripten-GLFW-WebGL version on: https://pallas.ti.bfh.ch/slproject/
Just choose the menu Infos > Statistics > Stats on ImGui and then unfold the Tools group:
Overlap-Problem
It has nothing to do with docking.
I will investigate further on
glfwGetWindowSize(bd->Window, &w, &h);
glfwGetFramebufferSize(bd->Window, &display_w, &display_h);
and also check our non-GLFW builds on Android and iOS.

By the way, Thanks a lot for ImGui and your amazing work!
Marcus

from imgui.

hsm4 avatar hsm4 commented on July 16, 2024

I guess I'm using an outdated OpenGL3 ImGui rendering.
I have everywhere a io.DisplayFramebufferScale of [1,1]. On MacOS I'm requesting the OpenGL context with glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GL_FALSE);

from imgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.