Refactor int to float missing parse (#5503)

* refactor int to float parse

* Reverting  as requested

---------

Co-authored-by: Maicon <maicon@thinkpad02.exads.com>
This commit is contained in:
Maicon Santana
2026-01-24 20:53:22 +00:00
committed by GitHub
parent 70a63f7c62
commit afe74c1c70
21 changed files with 62 additions and 62 deletions

View File

@ -45,7 +45,7 @@ int main(void)
for (int i = 0; i < MAX_COLORS_COUNT; i++)
{
colorsRecs[i].x = 20.0f + 100.0f *(i%7) + 10.0f *(i%7);
colorsRecs[i].y = 80.0f + 100.0f *(i/7) + 10.0f *(i/7);
colorsRecs[i].y = 80.0f + 100.0f *((float)i/7) + 10.0f *((float)i/7);
colorsRecs[i].width = 100.0f;
colorsRecs[i].height = 100.0f;
}

View File

@ -311,7 +311,7 @@ static void DrawDisplaySegment(Vector2 center, int length, int thick, bool verti
(Vector2){ center.x + thick/2.0f, center.y - length/2.0f }, // Point 3
(Vector2){ center.x - thick/2.0f, center.y + length/2.0f }, // Point 4
(Vector2){ center.x + thick/2.0f, center.y + length/2.0f }, // Point 5
(Vector2){ center.x, center.y + length/2 + thick/2.0f }, // Point 6
(Vector2){ center.x, center.y + (float)length/2 + thick/2.0f }, // Point 6
};
DrawTriangleStrip(segmentPointsV, 6, color);

View File

@ -49,8 +49,8 @@ int main(void)
float totalM = m1 + m2;
Vector2 previousPosition = CalculateDoublePendulumEndPoint(l1, theta1, l2, theta2);
previousPosition.x += (screenWidth/2);
previousPosition.y += (screenHeight/2 - 100);
previousPosition.x += ((float)screenWidth/2);
previousPosition.y += ((float)screenHeight/2 - 100);
// Scale length
float L1 = l1*lengthScaler;
@ -105,8 +105,8 @@ int main(void)
// Calculate position
Vector2 currentPosition = CalculateDoublePendulumEndPoint(l1, theta1, l2, theta2);
currentPosition.x += screenWidth/2;
currentPosition.y += screenHeight/2 - 100;
currentPosition.x += (float)screenWidth/2;
currentPosition.y += (float)screenHeight/2 - 100;
// Draw to render texture
BeginTextureMode(target);