Skip to content
This repository was archived by the owner on May 25, 2020. It is now read-only.
This repository was archived by the owner on May 25, 2020. It is now read-only.

Error in setLinearAngle #6

Description

@insad

There's an error in gpickr.js - setLinearAngle, lines 403/404:

angle = typeof angle === 'number' ? angle : (normalize.angleToDegrees(angle) || (this._angles.find(v => v.name === angle) || {}).angle);

when angle = '0deg', normalize.angleToDegrees(angle) returns (correctly) 0, but in this case in the expression this is considered as logical "false", so lines 403/404 return a value of 'undefined' !

I solved it in the following way:

if (typeof angle !== 'number') { if ((angle = normalize.angleToDegrees(angle)) === null) { angle = (this._angles.find(v => v.name === angle) || {}).angle; } }

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