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 ui::Layout scissor clipping #20352

Merged
merged 15 commits into from Nov 20, 2019

Conversation

@rh101
Copy link
Contributor

rh101 commented Nov 20, 2019

This will fix the issue reported in #19890

The SCISSOR clipping position was not being calculated correctly. It affected any UI element that uses this, including ui::Layout, ui::ScrollView etc.

Also added test case to reproduce the issue and to show that the fix works.

rh101 added 14 commits May 29, 2019
Sync with master branch
Set the PMA parameter to true when calling initWithRawData() inside RenderTexture::newImage(), since textures are PMA.
Renamed Image::premultipliedAlpha() to Image::premultiplyAlpha() to better reflect it's action, and made it public.
Added Image::reversePremultipliedAlpha() to allow the reversing of the PMA.
Updated CCImage-ios.mm to set the correct bitmapInfo for PMA and non-PMA images before saving a file.
Updated RenderTextureTest::RenderTextureSave() to cater for non-PMA file saving.
Sync with master branch
Synced with master branch
Sync with master
Sync with master
Sync with master branch
Sync with master
Sync with master
Sync with master
Sync with master
Sync with master
[UILayoutTest.cpp] Test added to reproduce issue with SCISSOR clipping.
@minggo
minggo approved these changes Nov 20, 2019
parentClippingRect = _clippingParent->getClippingRect();
float finalX = worldPos.x - (scissorWidth * _anchorPoint.x);
float finalY = worldPos.y - (scissorHeight * _anchorPoint.y);
const Rect parentClippingRect = _clippingParent->getClippingRect();

This comment has been minimized.

Copy link
@minggo

minggo Nov 20, 2019

Contributor

Use reference instead?

This comment has been minimized.

Copy link
@rh101

rh101 Nov 20, 2019

Author Contributor

Sure I'll update that now

@minggo minggo merged commit 651acd0 into cocos2d:v3 Nov 20, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@minggo minggo added this to the next milestone Nov 20, 2019
@rh101 rh101 deleted the rh101:fix-layout-scissor-clipping branch Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.