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

A problem with textAlign documentation #5142

Closed
1 task done
JimBrink opened this issue Mar 30, 2021 · 5 comments
Closed
1 task done

A problem with textAlign documentation #5142

JimBrink opened this issue Mar 30, 2021 · 5 comments
Assignees

Comments

@JimBrink
Copy link

JimBrink commented Mar 30, 2021

Most appropriate sub-area of p5.js?

  • Other (specify if possible)
    documentation

Details about the bug:

The documentation page https://p5js.org/reference/#/p5/textAlign seems to have 2 problems:

  1. Nowhere does it say the default vertical alignment is "BASELINE" if the
    textAlign call does not specify the vertical alignment.
  2. The second example on that page shows the BASELINE alignment as being the same as TOP. (The may be problem with the p5,js source file the documentation uses.)
  • p5.js version : p5.js v1.2.0 Dec
  • Web browser and version: <Firefox vs 87.0, opera (Same results for both the code below and on the documentation page.
  • Operating System: Windows 10
  • Steps to reproduce this: Compare the results for "BASELINE" shown on the document page with those in this code.
function setup() {

  createCanvas(400, 100);
  background("GRAY");
  fill(255);
}

function draw() {

  line(0,30,400,30);
  text('default', 30, 30);
  textAlign(CENTER, TOP);
  text("TOP", 110, 30);
  textAlign(CENTER, BASELINE);
  text ("BASELINE", 190, 30);
  textAlign(CENTER, BOTTOM);
  text ("BOTTOM", 270, 30);
  textAlign(CENTER, CENTER);
  text ("CENTER", 350, 30);
  noLoop();
}  
@JimBrink JimBrink added the Bug label Mar 30, 2021
@two-ticks
Copy link
Contributor

Are you working on this issue? I would like to work on this issue.

@limzykenneth
Copy link
Member

@two-ticks If you are still interested, do have go ahead. I think there are some weird behaviour going on so do have a closer look while you are working on this.

@dhowe
Copy link
Contributor

dhowe commented Jun 13, 2021

@two-ticks please also compare to processing: https://processing.org/reference/textAlign_.html

@Qianqianye
Copy link
Contributor

Thanks @two-ticks. I just assigned you on this.

@Qianqianye
Copy link
Contributor

Closing this since it's resolved in #6854

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

No branches or pull requests

5 participants