-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
cocos2d-x 3.7.1 scale-9 sprite works different from the previous one #13560
Comments
@ryule For the issue 2: Could you give an example? Or could we just make them as protected such that the subclass could use it. Thanks. |
Hi, @ryule |
@zilongshanren, your commit 6cea66f fixed the first issue, thanks! For the second issue, a stand alone texture cache manager that independent to the given Thanks. |
@ryule If most developers want these APIs, then we would consider public them. Thanks. |
Sure, it's fine. I really appreciate your effort for this issue. |
@ryule You're welcome. |
In new cocos2d-x, 9-patch functionality has been added to
ui::Scale9Sprite
.But the changed code affects the way of working of the original Scale9Sprite.
(Reference commit: 0352a7a)
1. The Scale9Sprite works weird
because the following code:
if(_capInsets.equals(Rect::ZERO))
if(!capInsets.equals(Rect::ZERO))
For example,
setInsetLeft/Top/Right/Bottom
methods callupdateWithSprite
.(
setInset*
>updateCapInset
>setCapInsets
>updateWithSprite
finally)If a series of
setInset*
method call is happened thenthe above
if
s will work as an unintended way.I don't know why those
if
conditions needed exactly, but if they are for9-patch functionality then the other condition check should be added such as
&& _isPatch9
.2. CCTexture2D contains private methods related to 9-patch sprite
isContain9PatchInfo, getSpriteFrameCapInset, removeSpriteFrameCapInset, and addSpriteFrameCapInset
.Due to this structure there is no way to write and extend the codes that manage
cocos2d::SpriteFrame
as 9-patch sprites manually.I think those methods mentioned above would be declared as public.
The text was updated successfully, but these errors were encountered: