Skip to content

Fix: logical or on methods taking optional params #13

Description

@devloop01

on methods like set() the second param is optional. If the second param is optional it will set the second prop as the value for the first param.

That sounds fine on paper but the problem is with values such as 0.
say if the second param is 0 then it will be ignored and the second prop (here it's y) will be set as the first param

eg:

const a = vec2()
a.set(1, 2) // it works because the value is non-zero. so a.x = 1 & a.y = 2
a.set(1, 0) // here, a.x = 1 & a.y = 1
// expected a.x = 1 and a.y = 0 but it isn't the case here

I think this issue is also with other methods using || operator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions