Skip to content

fix getTiledTileAt cause layer show wrong. #10137

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

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

zhakesi
Copy link
Contributor

@zhakesi zhakesi commented Feb 21, 2022

fix tiled tile show with wrong position.

@zhakesi zhakesi requested a review from SantyWang February 21, 2022 06:28
@github-actions
Copy link

Interface Check Report

This pull request does not change any public interfaces !

@zhakesi zhakesi requested a review from pandamicro February 21, 2022 06:34
@@ -533,10 +533,14 @@ function fillByTiledNode (tiledNode: Node, color: Float32Array, vbuf: Float32Arr
const vertStep2 = vertStep * 2;
const vertStep3 = vertStep * 3;

const layerMat = tiledNode.parent!.worldMatrix;
const tiledMat = Mat4.IDENTITY.clone();
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't create temporary memory here

tiledNode.updateWorldTransform();
Mat4.fromRTS(_mat4_temp, tiledNode.getRotation(), tiledNode.getPosition(), tiledNode.getScale());
Mat4.fromRTS(tiledMat, tiledNode.getRotation(), tiledNode.getPosition(), tiledNode.getScale());
Copy link
Contributor

Choose a reason for hiding this comment

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

All getXXX API will create temporary memory

@pandamicro pandamicro merged commit c516846 into cocos:v3.4.2 Feb 21, 2022
@zhakesi zhakesi deleted the v3.4.2-tiled-tile branch February 7, 2023 13:47
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.

3 participants