P5.js: 1.0.0 broke syntax for square with rounded corners

Created on 3 Mar 2020  路  10Comments  路  Source: processing/p5.js

Most appropriate sub-area of p5.js?

  • [ ] Color
  • [x] Core/Environment/Rendering
  • [ ] Data
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [ ] Math
  • [ ] Typography
  • [ ] Utilities
  • [ ] WebGL
  • [ ] Other (specify if possible)

Details about the bug:

  • p5.js version: 1.0.0
  • Steps to reproduce this:
// with 0.10.2: 
  square(x, y, size, corner_radius);

// with 1.0.0:
  square(x, y, size, size, corner_radius);
core bug

Most helpful comment

@stalgiag that鈥檚 my best guess too, and it鈥檚 likely that i broke this since i touched it last 馃槀

will have a look later today!

thanks for reporting this @mcgittyhub!

All 10 comments

Welcome! 馃憢 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

@McGittyHub @stalgiag Working on this issue. It may have been arisen due to some typo during parsing arguments in square method. Fixing in a while.

@McGittyHub I don't think this is a bug. You must have created the canvas in WEBGL mode in version 1.0.0. That's why it is showing irrelevant behavior.
You can reproduce the code given below to get the desired output.

    function setup() {
        createCanvas(200, 200);
        square(70, 70, 60, 10);
      }

In WebGL mode, the addition argument represents:

detailX Integer: number of segments in the x-direction (for WebGL mode) (Optional)
detailY Integer: number of segments in the y-direction (for WebGL mode) (Optional)

That's why you are not getting the desired output.
@stalgiag You can close this issue.

using your code produces:

image

I have to add a second 60 to get the desired (rounded square) result:
image

@McGittyHub That's strange. On the Web Editor, I get:
image
And for double 60, I got:
image
Not sure why

Please make sure that you're in fact running the 1.0.0 version and not 0.10.2 as is default on the web editor:
image

I assumed the web editor to use v 1.0.0 but don't think that's the case. It's still using 0.10.2 somehow. Correcting in a while. Thanks for the well-written issue. It's my bad that I assumed it is working fine.

Thank you for the issue @McGittyHub !

Could it be the handling of arguments in this function? I can't parse this quickly enough right now but it seems plausible.

@outofambit would you be willing to take a look?

@stalgiag that鈥檚 my best guess too, and it鈥檚 likely that i broke this since i touched it last 馃槀

will have a look later today!

thanks for reporting this @mcgittyhub!

@McGittyHub @stalgiag @outofambit Please take a look into the mentioned PR.

Was this page helpful?
0 / 5 - 0 ratings