Skip to content

in Webgl Mode, textAscent() stays sticked to the first call result and is never updated.  #4958

@pirelaurent

Description

@pirelaurent

Most appropriate sub-area of p5.js?

  • Accessibility (Web Accessibility)
  • Build tools and processes
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Friendly error system
  • Image
  • IO (Input/Output)
  • Localization
  • Math
  • Unit Testing
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Details about the bug:

in Webgl Mode, textAscent() stays sticked to the first call result and is never updated.
in P2D textAScent() works correctly with same code :
Screen Shot 12-20-20 at 10 24 AM 001
Screen Shot 12-20-20 at 10 25 AM

Same thing of course for textDescent() .

  • p5.js version: p5.js v1.1.9 July 22, 2020
  • Web browser and version: chrome 87.0.4280.88 (Build officiel) (64 bits) same on Firefox: 84.0
  • Operating System: windows 10 64bits
  • Steps to reproduce this:
    ( note: font is loaded in preload . Tests done with verdana.ttf & consolab.ttf )
function setup() {
  createCanvas(900, 900, WEBGL);
}

function draw() {
 translate(-width/2,-height/2);
  background(0);
  fill('white');
  textFont(consola);
  textSize(12);
  text('WEBGL : textAscent', 200,20);
  text('12: '+textAscent(), 20,20);
  textSize(14);
  text('14: '+textAscent(), 20,40);
  textSize(16);
  text('16: '+textAscent(), 20,60);
  textSize(32);
  text('32: '+textAscent(), 20,100);
 }

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

DONE! 🎉

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions