Skip to content

uilayout clipping issue in latest code #19733

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

Closed
fresair opened this issue May 17, 2019 · 1 comment
Closed

uilayout clipping issue in latest code #19733

fresair opened this issue May 17, 2019 · 1 comment
Assignees
Milestone

Comments

@fresair
Copy link

fresair commented May 17, 2019

  • cocos2d-x version:newest code on git (version commit 023b172 6 hours ago is not good. version 3.17.1 is going well)
  • devices test on: iphone 6sp and some simulators
  • developing environments
    • NDK version:
    • Xcode version:10.2.1
    • VS version:
    • browser type and version:

Steps to Reproduce:

add following code in hello world project
1.

var bg = new ccui.Layout();
bg.setAnchorPoint(0, 0);
bg.setTag(125);
bg.setContentSize(cc.size(300, 60));//300
bg.setClippingEnabled(true);
                                      
var imagetest=new cc.Sprite(res.HelloWorld_png);
imagetest.setAnchorPoint(0, 0);
 imagetest.setPosition(0, 0);
bg.addChild(imagetest);
bg.setPosition(size.width / 2+100, size.height / 2);
this.addChild(bg);
bg.setContentSize(cc.size(300, 60));
  1. if the last line x value not 0 (in the above code is 300) , the code behave well, clipping is ok.
    But if use 0 like bg.setContentSize(cc.size(0, 60)); clipping not work, you still can see the attached image which supposed to hidden totally.
@fresair fresair changed the title uilayout clipping issue in newest code uilayout clipping issue in latest code May 17, 2019
@fresair
Copy link
Author

fresair commented May 28, 2019

in CCDrawNode.cpp
I roll back cursor = Triangulate::processTriangles(verts,cursor,count,fillColor); to old function blew, then the uilayout behave ok again.

for (int i = 0; i < count-2; i++)
{
V2F_C4B_T2F_Triangle tmp = {
{verts[0], Color4B(fillColor), __t(v2fzero)},
{verts[i+1], Color4B(fillColor), __t(v2fzero)},
{verts[i+2], Color4B(fillColor), __t(v2fzero)},
};

        *cursor++ = tmp;
    }

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

No branches or pull requests

3 participants