Comments (5)
It's not possible what's what the assert is saying. I don't understand why you would want it?
from imgui.
To clarify,
- your custom widget can add an extra if statement to avoid submitting empty one or handle this edge case.
- whereas if we remove this assert and claim to support it, users may accidentally have issues passing a zero value and never understanding where the widget is gone. Especially as for some API (0,0) may mean "fill available space" but not for this one.
from imgui.
I am assuming you can add the extra if in your custom widget, let us know if you feel this is a problem.
Closing.
from imgui.
Obviously, a custom widget can make an extra check before calling InvisibleButton()
. I created the issue from the point of view that in general, size 0 is valid for ImGui widgets, cf. Dummy()
, SmallButton()
, and then there's one widget that crashes the whole program when given size 0.
from imgui.
I thought about it again and would like to confirm my first impression.
Button({0,0})
uses label size aka automatic sizing, just as many other widgets treat {0,0} as automatic sizing. InvisibleButton()
doesn't have a label. If you pass {0,0} following a computation and the widget is automatic sized it's likely a mistake but one that becomes easy to spot.
I don't think there's a neat parallel possible with other widgets, it's just that InvisibleButton()
cannot support automatic sizing.
Dummy({0,0})
indeed works but generally it wouldn't be "harmful" if you submit this or miscompute.
from imgui.
Related Issues (20)
- a magical problem about ImGui_ImplWin32_EnableAlphaCompositing api HOT 3
- Child windows and docking + IsWindowFocused HOT 3
- Table Not Automatically Adjusting Column width to contained controls. HOT 4
- Automatic button color change on hover HOT 2
- SDL_SetTextInputArea (in ImGui 1.90.9) no longer available >>> SDL_SetTextInputRect HOT 3
- Is Carriage Return usable is window label? HOT 1
- [Bug?] Large (font size) merged fonts leading to blocky, fat text HOT 1
- How to never steal keyboard/window focus but process mouse and keyboard keys ? HOT 3
- Trying to get ImGui to work in high dpi mode with sdl3 renderer backend but its not actually drawing in high dpi.
- I think it's a very old bug in the tables. HOT 1
- Scroll (SetScrollHereY) precision issue with messy font size float (and solution) HOT 3
- FullScreen Mode Issue on MacBook Air M3: Toolbar Buttons Misaligned and Unresponsive Due to Notch HOT 3
- Window goes blank on AMD GPU (driver issue) HOT 8
- Transparent windows in a secondary viewport HOT 3
- Sub sub-menu fail to display using ImGuiConfigFlags_ViewportsEnable HOT 3
- Unmapped Memory Access
- Style color for active input field (feature request) HOT 2
- Frame rate control for individual windows HOT 1
- DirectX12 'ft2build.h' : No such file or directory
- SetNextWindowRefreshPolicy issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgui.