Skip to content

Conversation

@EdgeCraftStudios
Copy link

Summary

This PR addresses a runtime error in the raygui_custom_file_dialog example where the function draw_rectangle_rounded_lines() was called with 5 arguments instead of the 4 expected by the pyray

Problem

Error Message:

TypeError: DrawRectangleRoundedLines expected 4 arguments, got 5

Cause:

The original example used the raylib C API:

DrawRectangleRoundedLines(rect, roundness, segments, lineThick, color);

However, pyray (Python bindings for raylib) defines the function with 4 arguments, excluding lineThick:

draw_rectangle_rounded_lines(rect: Rectangle, roundness: float, segments: int, color: Color)

Fix

The incorrect argument (lineThick) has been removed to match pyray's signature.

Testing

  • Launched the gui\custom_file_dialog example.
  • Opened the file dialog.
  • Selected and displayed a .png image.
  • No errors or crashes occurred.

@electronstudio
Copy link

The C API and the Pyray API signatures are the same so that wasnt the cause of the problem. The number of arguments was changed from 5 to 4 with the release of Raylib 5.5. So it seems the example was from Raylib 5.0.

Btw you’ve made a lot of other changes to the file beyond just fixing the bug. (I’m not a reviewer for this project though, so maybe that’s fine.)

@EdgeCraftStudios
Copy link
Author

waiting for review

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