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

Dynamic Texture context.drawImage does not work with context.clip #1184

Closed
SergioRZMasson opened this issue Dec 26, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@SergioRZMasson
Copy link
Contributor

Overview

When using context.drawImage after a context.clip the image is not properly drawn using the curve previously set. This bug was reported on the forum.

To Reproduce
Using a dynamic texture construct a path than call context.clip and context.drawImage:

//Create path
textureContext.beginPath();
textureContext.moveTo(75*2, 25*2);
textureContext.quadraticCurveTo(25*2, 25*2, 25*2, 62.5*2);
textureContext.quadraticCurveTo(25*2, 100*2, 50*2, 100*2);
textureContext.quadraticCurveTo(50*2, 120*2, 30*2, 125*2);
textureContext.quadraticCurveTo(60*2, 120*2, 65*2, 100*2);
textureContext.quadraticCurveTo(125*2, 100*2, 125*2, 62.5*2);
textureContext.quadraticCurveTo(125*2, 25*2, 75*2, 25*2);
textureContext.strokeStyle = "white";
textureContext.stroke();

//Clip and draw image.
textureContext.clip();
textureContext.drawImage(this, 0, 0);

Expected behavior
Expected behavior should match the following playground: https://playground.babylonjs.com/#FU0ES5#25

@thomlucc
Copy link
Member

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants