Immediate-Mode-UI / Immediate-Mode-UI/Nuklear

there are several stuct fields with int types but bool semantics (and all kinds of integer shenanigans)

Open
#891 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
11.4k
Forks
686
Avg merge
4d 1h
Merged PRs (30d)
3

Description

This is a follow up from https://github.com/Immediate-Mode-UI/Nuklear/pull/883

> > > > Change the field type in nk_style_slider and nk_style_scrollbar to nk_bool.
> > >
> > > I would rather not do this. Not only there are way more int fields with bool semantics like these two, there is simply no other use of nk_bool type anywhere in the style structs (EDIT: I think I found one somewhere). If you want these two changed, you should probably also change other similar fields elsewhere [...]
> >
> > I may missing something, but I’m not entirely sure why this issue is being generalized to such a broad scope in the discussion. [...] broadening the problem to all similar cases, the conclusion naturally becomes that fixing it would be complex and risky. To me, this feels like a conceptual trap.
>
> Those were the only ones that we had the code coverage to catch.

https://github.com/Immediate-Mode-UI/Nuklear/blob/25f33c8780a8b41668447f83e7d154e735cf424f/src/nuklear.h#L4642
https://github.com/Immediate-Mode-UI/Nuklear/blob/25f33c8780a8b41668447f83e7d154e735cf424f/src/nuklear.h#L5038
https://github.com/Immediate-Mode-UI/Nuklear/blob/25f33c8780a8b41668447f83e7d154e735cf424f/src/nuklear.h#L5134
https://github.com/Immediate-Mode-UI/Nuklear/blob/25f33c8780a8b41668447f83e7d154e735cf424f/src/nuklear.h#L5359
https://github.com/Immediate-Mode-UI/Nuklear/blob/25f33c8780a8b41668447f83e7d154e735cf424f/src/nuklear.h#L5741

^ Those are the ones I was able to quickly find. There are probably more.

I personally do NOT want to change any of this. It can cause more issues like https://github.com/Immediate-Mode-UI/Nuklear/issues/812 and this isn't affecting any new code anyway. I gave many reasons under https://github.com/Immediate-Mode-UI/Nuklear/pull/883 why changing any of those struct fields is risky.

I'm only reporting this for the sake of documenting. I will not be doing anything about it myself, and would suggest everyone else to ignore it, at least for now.

Edit: related to: https://github.com/Immediate-Mode-UI/Nuklear/issues/183 ; https://github.com/Immediate-Mode-UI/Nuklear/pull/185

Contributor guide

Open the contributing guide

Research direction

Start by reading the discussion on PR #883 and the cited declarations in src/nuklear.h at lines 4642, 5038, 5134, 5359, and 5741. Review the related issues #812 and #183 and PR #185 to understand the compatibility concerns; done means documenting a decided scope or rationale, not changing the struct fields without maintainer agreement.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
frontend
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.