Skip to content

fix: Setting renderSceneColorMap or renderSceneDepthMap to true when already set, sets it to false#8731

Open
MAG-AdrianMeredith wants to merge 1 commit into
playcanvas:mainfrom
MAG-AdrianMeredith:fix/dodgy-renderSceneColorMap
Open

fix: Setting renderSceneColorMap or renderSceneDepthMap to true when already set, sets it to false#8731
MAG-AdrianMeredith wants to merge 1 commit into
playcanvas:mainfrom
MAG-AdrianMeredith:fix/dodgy-renderSceneColorMap

Conversation

@MAG-AdrianMeredith
Copy link
Copy Markdown
Contributor

Setting renderSceneColorMap or renderSceneDepthMap to true when already set, sets it to false

Description

I don't have a proveable issue here but I saw this function and it sounds dodgy af. Passing true can cause it to set it to false, it seems unlikely to be intentional

Fixes #
n/a

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a logic bug in CameraComponent's renderSceneColorMap and renderSceneDepthMap setters where setting the value to true while it was already requested would incorrectly disable the map. The condition is updated to only release the request when value is falsy.

Changes:

  • Add !value && guard to the else if branch in the renderSceneColorMap setter.
  • Add !value && guard to the else if branch in the renderSceneDepthMap setter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants