diff options
| author | Jeffery Myers <[email protected]> | 2021-03-22 23:51:52 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-23 07:51:52 +0100 |
| commit | e48b9a6da1d3dd6163b1596e47c58e7026530dc1 (patch) | |
| tree | 9d1bca87d19ae07f7605c112c53971531b109dc2 /examples/text/text_rectangle_bounds.c | |
| parent | c6dd41495b2c0d96cf4d1ca108729ec87c9a0b53 (diff) | |
| download | raylib-e48b9a6da1d3dd6163b1596e47c58e7026530dc1.tar.gz raylib-e48b9a6da1d3dd6163b1596e47c58e7026530dc1.zip | |
[Examples] Warning fixes (pt 1) (#1668)
* Fix some warnings in examples.
* cleanups from review
Co-authored-by: Jeffery Myers <[email protected]>
Diffstat (limited to 'examples/text/text_rectangle_bounds.c')
| -rw-r--r-- | examples/text/text_rectangle_bounds.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/text/text_rectangle_bounds.c b/examples/text/text_rectangle_bounds.c index 870561e1..21dfcd91 100644 --- a/examples/text/text_rectangle_bounds.c +++ b/examples/text/text_rectangle_bounds.c @@ -33,10 +33,10 @@ tempor incididunt ut labore et dolore magna aliqua. Nec ullamcorper sit amet ris Rectangle resizer = { container.x + container.width - 17, container.y + container.height - 17, 14, 14 }; // Minimum width and heigh for the container rectangle - const int minWidth = 60; - const int minHeight = 60; - const int maxWidth = screenWidth - 50; - const int maxHeight = screenHeight - 160; + const float minWidth = 60; + const float minHeight = 60; + const float maxWidth = screenWidth - 50; + const float maxHeight = screenHeight - 160; Vector2 lastMouse = { 0.0f, 0.0f }; // Stores last mouse coordinates Color borderColor = MAROON; // Container border color @@ -63,10 +63,10 @@ tempor incididunt ut labore et dolore magna aliqua. Nec ullamcorper sit amet ris { if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) resizing = false; - int width = container.width + (mouse.x - lastMouse.x); + float width = container.width + (mouse.x - lastMouse.x); container.width = (width > minWidth)? ((width < maxWidth)? width : maxWidth) : minWidth; - int height = container.height + (mouse.y - lastMouse.y); + float height = container.height + (mouse.y - lastMouse.y); container.height = (height > minHeight)? ((height < maxHeight)? height : maxHeight) : minHeight; } else |
