Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unable to pass tuple to SDL_RenderDrawPointF #159

Copy link
Copy link
Closed
@gbwellman

Description

@gbwellman
Issue body actions

I'm trying to pass a tuple to context.sdl_renderer.draw_point(xy) to draw a point

Gives a type error.

_check(lib.SDL_RenderDrawPointF(self.p, (xy,)))
       ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: SDL_RenderDrawPointF expected 3 arguments, got 2

Looking at the code:

_check(lib.SDL_RenderDrawPointF(self.p, (xy,)))

This appears to fix the issue:

    def draw_point(self, xy: tuple[float, float]) -> None:
    """Draw a point.

    .. versionadded:: 13.5
    """
    #_check(lib.SDL_RenderDrawPointF(self.p, (xy,))) <- original
    _check(lib.SDL_RenderDrawPointF(self.p, xy[0],xy[1])) #<-fix

Am I doing something wrong with how I am structuring my tuple?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.