Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angleMode() returns undefined with not passed any arguments #5842

Closed
1 of 17 tasks
calebfoss opened this issue Oct 19, 2022 · 4 comments
Closed
1 of 17 tasks

angleMode() returns undefined with not passed any arguments #5842

calebfoss opened this issue Oct 19, 2022 · 4 comments
Assignees

Comments

@calebfoss
Copy link
Contributor

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.4.1

Web browser and version

Chrome 106.0.5249.119

Operating System

Windows

Steps to reproduce this

The reference reads "Calling angleMode() with no arguments returns current anglemode." but the function instead returns undefined.

The private field _angleMode seems to hold the value "radians" regardless of the current anglemode.

I'm not sure what's happening here, but I'm happy to work on this. If anyone has any insights on what might be causing the issue, please let me know.

Snippet:

function setup() {
  angleMode(DEGREES);
  print(angleMode());  //  prints 'undefined'
  angleMode(RADIANS);
  print(angleMode());  //  prints 'undefined' again
}
@calebfoss calebfoss added the Bug label Oct 19, 2022
@calebfoss calebfoss self-assigned this Oct 19, 2022
@welcome
Copy link

welcome bot commented Oct 19, 2022

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

@davepagurek
Copy link
Contributor

Hi! I think this issue might be resolved in newer versions of p5. I copied your code into a p5 editor sketch here: https://editor.p5js.org/davepagurek/sketches/O21HMKpYa At first it got the same output as you mentioned, but after changing index.html to load p5 1.4.2 instead of 1.4.1, I see the correct output again. Does that also work for you?

@TornadoMC2
Copy link

It looks like this was already fixed in #5682 and the website just hasn't been updated to default to that version of p5

@davepagurek
Copy link
Contributor

ok great! I'm going to close this now for organizational purposes but feel free to open this up again if there's anything we missed or if this comes up again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants