Skip to content

slider: Fix float type conversion#948

Open
RobLoach wants to merge 1 commit intomasterfrom
fix-type-conversion-visual-sursor
Open

slider: Fix float type conversion#948
RobLoach wants to merge 1 commit 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

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

Choose a reason for hiding this comment

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

Oh, my bad, sorry. As long as we're making a fix here can you fix the spacing around the +?

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

I don't really mind a+b or a + b and I do both depending on the situation but I can't believe I let that lopsided monstrosity through.

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.

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

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;

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