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

Fix the viewport of ViewportQuad is not applied #9511

Merged
merged 3 commits into from
May 2, 2021
Merged

Fix the viewport of ViewportQuad is not applied #9511

merged 3 commits into from
May 2, 2021

Conversation

bbbbx
Copy link
Contributor

@bbbbx bbbbx commented Apr 27, 2021

fix #9167

@cesium-concierge
Copy link

Thanks for the pull request @bbbbx!

  • ✔️ Signed CLA found.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@@ -135,6 +135,7 @@ ViewportQuad.prototype.update = function (frameState) {

this._material.update(context);

this._overlayCommand.renderState = this._rs;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix, @bbbbx!

@lilleyse - This change makes sense to me but I'm unable to reproduce the bugged behavior on my Linux machine. Any thoughts on this fix? I wonder if it's somehow possible to simulate a render state change in the ViewportQuad specs.

Copy link
Contributor

@lilleyse lilleyse Apr 27, 2021

Choose a reason for hiding this comment

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

Should be straightforward to test by setting the rectangle after it's been created and observing that the command's render state has the correct viewport. Something like:

    it("updates rectangle", function () {
      var otherRectangle = new BoundingRectangle(0, 0, 4, 4);

      scene.primitives.add(viewportQuad);
      scene.renderForSpecs();

      viewportQuad.rectangle = otherRectangle;
      scene.renderForSpecs();
      expect(scene.frameState.commandList[0].renderState.viewport).toEqual(
        otherRectangle
      );
    });

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I can confirm this PR fixes the bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, I have added the test, could you review it again? Thanks @lilleyse @ebogo1

CHANGES.md Outdated Show resolved Hide resolved
Co-authored-by: Eli Bogomolny <[email protected]>
@ebogo1
Copy link
Contributor

ebogo1 commented May 2, 2021

Thanks @bbbbx!

@ebogo1 ebogo1 merged commit 93b4a78 into CesiumGS:master May 2, 2021
@bbbbx bbbbx deleted the fix-viewportquad branch May 2, 2021 05:15
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.

set ViewportQuad.rectangle doesn't work
4 participants