Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -25958,7 +25958,7 @@ nk_draw_slider(struct nk_command_buffer *out, nk_flags state,
bar.h = style->bar_height;

/* 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.

fill.x = bar.x;
fill.y = bar.y;
fill.h = bar.h;
Expand Down
2 changes: 1 addition & 1 deletion src/nuklear_slider.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ nk_draw_slider(struct nk_command_buffer *out, nk_flags state,
bar.h = style->bar_height;

/* 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;
Comment thread
RobLoach marked this conversation as resolved.
Outdated
fill.x = bar.x;
fill.y = bar.y;
fill.h = bar.h;
Expand Down
Loading