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

PShape.scale not working with PShape.resetMatrix when P2D renderer is used #217

Closed
processing-bot opened this issue Jun 30, 2021 · 5 comments
Labels
has attachment Attachment was not transfered from GitLab help wanted Extra attention is needed opengl

Comments

@processing-bot
Copy link
Collaborator

Created by: Reantric

Description

PShape.scale does not play well with PShape.resetMatrix when P2D renderer is selected.

Expected Behavior

I believe this to be a bug. I expected the ellipse to be drawn and scaled up absolutely by 2. I tried other svg's (loadShape) and the problem still occurred.
Without P2D:
image
With P2D:
image

Current Behavior

The ellipse is not drawn at all. I think the issue lies within PShape.scale because PShape.translate seems to work fine, or possibly P2D and PShapeOpenGL.

Steps to Reproduce

PShape s;

void setup(){
  size(1000,1000,P2D); // Removing P2D allows it to work.
    s = createShape(ELLIPSE,0,0,100,100);
}


void draw(){
  background(0);
  translate(width/2,height/2);
  // s.translate(-200,100); This works!
  s.scale(2);
  shape(s,0,0);
  s.resetMatrix();
} 

Your Environment

  • Processing version: 4.0a5
  • Operating System and OS version: Windows 10 Build 19041.1052
  • Other information:

Possible Causes / Solutions

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Hey there! Just a quick note that I believe I am seeing the same behavior on Processing 3. @protonlaser91, can you please confirm if you see this in Processing 3 as well?

@processing-bot
Copy link
Collaborator Author

Created by: Reantric

@sampottinger Apologies for the late reply, but yes I do see this on Processing 3 too.

@processing-bot
Copy link
Collaborator Author

Created by: github-actions[bot]

This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs.

@processing-bot
Copy link
Collaborator Author

Created by: codeanticode

The ultimate cause for this issue was an error in an internal utility to invert the scaling transformation in 2D, #366. Long term fix is included in this PR

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Fix incorporated for 4.0 beta 4.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has attachment Attachment was not transfered from GitLab help wanted Extra attention is needed opengl
Projects
None yet
Development

No branches or pull requests

1 participant