Skip to content

Using clip() prevents next loop render #8288

@ThatIsAPseudo

Description

@ThatIsAPseudo

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • p5.strands
  • WebGL
  • DevOps, Build process, Unit testing
  • Internationalization (i18n)
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.11.10

Web browser and version

Chromium 142.0.7444.180, Firefox 145.0.1

Operating system

macOS 15.7.2

Steps to reproduce this

When using clip(), nothing more is drawn in the canvas even in next loops.

Steps:

Execute the following code :

function setup(){
    createCanvas(100, 100);
}

function draw(){
    background('black');

    fill('white');
    text(frameCount, width/2, height/2);

    clip();
    // could also be beginClip(); endClip();

    // console.log(frameCount) will actually log numbers going up
}

Expected behaviour:

Text showing numbers going up in the canvas.

Actual behaviour:

Text displayed in the canvas is stuck on 1.
Note that the loop is still running, if I add a console.log(frameCount) in the draw function, it will actually log numbers going up.
Moreover adding push() pop() around clip() behaves the same.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions