Skip to content

Returning nan in tracking task #60

Description

@juliencegarra

def is_cursor_in_target(self):
if self.target_radius > 0:
return self.is_cursor_in_radius(self.target_radius)
else:
return float('nan')

float('nan') is truthy in Python, so callers using this value in a boolean context (track.py:78-83) will incorrectly treat "no target defined" as "cursor is in target". This causes wrong cursor color selection.

Consider returning False instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions