Skip to content

slider: Fix float type conversion#948

Merged
RobLoach merged 3 commits intomasterfrom
fix-type-conversion-visual-sursor
Apr 28, 2026
Merged

slider: Fix float type conversion#948
RobLoach merged 3 commits intomasterfrom
fix-type-conversion-visual-sursor

Conversation

@RobLoach
Copy link
Copy Markdown
Contributor

Small fix for visual_cursor type conversion.

Comment thread src/nuklear_slider.c Outdated
Comment thread nuklear.h Outdated

/* filled background bar style */
fill.w = visual_cursor->x+ 0.5*visual_cursor->w - bar.x;
fill.w = visual_cursor->x+ 0.5f*visual_cursor->w - bar.x;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fill.w = visual_cursor->x+ 0.5f*visual_cursor->w - bar.x;
fill.w = visual_cursor->x + 0.5f * visual_cursor->w - bar.x;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally prefer spaces on either side of every operator, but 🤷 ... What is represented elsewhere?

I think my natural tendency is to use no spaces to represent mental groupings to make it easier to read. I feel like longer expressions get harder to read if you use spaces everywhere and occasional tight couplings help you parse it better/more quickly, without the mess of unnecessary parenthesis.

But yes, I think spaces everywhere is more consistent with Nuklear's codebase in general, and for this function/file at the very least, so I think we're good.

@RobLoach RobLoach merged commit 068de25 into master Apr 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants