jvcleave / ofxImGui

Use ImGui in openFrameworks
300 stars 123 forks source link

Minimum window width and height since Vulkan engine added #58

Closed rjx-ray closed 6 years ago

rjx-ray commented 7 years ago

I'm using ofxImGui under Windows with of_v0.9.7_vs_release.

My application has a window with a height of 32 pixels which I position across the top of the app window and use as a menu bar. I built it using the commit of 22 February 2017 12:56:28 and it worked well. Now I have updated to the latest version of ofxImGui this menu bar window extends down over the app window shading it in an undesirable way. EG image It seems that the minimum height of a window is now 80 pixels, if you specify anything less it is drawn as 80 pixels high

I also have a 80 pixel square window which I use for navigation which was OK before and now is rectangular: image It seems that the minimum width of a window is now 160 pixels, if you specify anything less it is drawn as 160 pixels.

The behaviour can be demonstrated by adding this code to ImGuiTest and adjusting the float value

    int squareSize = (int) (floatValue * 1000);
    ImGui::SetNextWindowSize(ofVec2f(squareSize, squareSize));
    bool show = true;
    ImGui::Begin("R", &show);

    ImGui::End();

Checking out various commits the change came with the addition of the vulkan engine 18 May 2017 20:13:25

rjx-ray commented 6 years ago

Is there any hope of getting this fixed, or a workaround.? We have been using the old version of the addon ever since but that's no longer an option with the of_v0.10.0RC3_vs2017_release. I pulled the latest stretch commit [3a581c9] but the issue is still there.

Just to be clear, I am not using the Vulkan engine, I have the default ofConstants.h so it uses EngineGLFW() Its just that the issue arose with this commit [885a9a6]

There were some changes to EngineGLFW.cpp in that commit which I am not knowledgeable enough to understand but I am guessing may be the culprit?

rjx-ray commented 6 years ago

Double checking I discovered the issue actually arose in the next commit [63806bf] a few hours later. It was caused by the addition of the line theme->setup(); at the end of Gui::setTheme(BaseTheme* theme_) in Gui.cpp

BaseTheme::setup() ihas the line style->WindowMinSize = ImVec2(160, 65);

Now I know that, its easy to set my own WindowMinSize so its no longer an issue