Skip to content

textOutput() describes position incorrectly #6612

@nickmcintyre

Description

@nickmcintyre

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.9.0

Web browser and version

Chrome 118, Firefox 120, Safari 17

Operating System

macOS

Steps to reproduce this

Steps:

  1. Draw a circle at the center of the canvas.
  2. Call textOutput(LABEL) and view the results.
  3. Move the circle to the top-left to test an idea.
  4. Call pixelDensity(1) to test the idea a little more.

Original

function setup() {
  createCanvas(400, 400);
  textOutput(LABEL);
}

function draw() {
  background(220);
  circle(200, 200, 50);
}

The sketch above produces the following description:

Text Output

Your output is a, 400 by 400 pixels, white canvas containing the following shape:

  • white circle, at bottom right, covering 1% of the canvas.

white circle location = bottom right area = 1%

Move the circle to the top-left

function setup() {
  createCanvas(400, 400);
  textOutput(LABEL);
}

function draw() {
  background(220);
  circle(100, 100, 50);
}

The sketch above produces the following description:

Text Output

Your output is a, 400 by 400 pixels, white canvas containing the following shape:

  • white circle, at middle, covering 1% of the canvas.

white circle location = middle area = 1%

Change the pixel density

function setup() {
  createCanvas(400, 400);
  textOutput(LABEL);
  pixelDensity(1);
}

function draw() {
  background(220);
  circle(200, 200, 50);
}

The sketch above produces the following description:

Text Output

Your output is a, 400 by 400 pixels, white canvas containing the following shape:

  • white circle, at middle, covering 1% of the canvas.

white circle location = middle area = 1%

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions