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

Composite recalculates it's size wrong when items are rotated #165

Closed
azakhary opened this issue Aug 7, 2015 · 8 comments
Closed

Composite recalculates it's size wrong when items are rotated #165

azakhary opened this issue Aug 7, 2015 · 8 comments
Assignees
Labels

Comments

@azakhary
Copy link
Contributor

azakhary commented Aug 7, 2015

No description provided.

@dsaltares
Copy link
Contributor

Is this related to the editor? In the editor, the only thing I found is that you need to click the composite item for the boundingbox to be updated after a rotation.

wrong rotation

@azakhary
Copy link
Contributor Author

not only, we had issues with composite recalculation not taking in account transformations, which I think @gevorg-kopalyan have gixed, but I am not sure if he have made a PR. @gevorg-kopalyan can you confirm?

@gevorg-kopalyan
Copy link
Contributor

Yeah the fix with transforms is there, but as David mentioned, it only updates Follower box on click, which is an issue on Follower part I guess.

@azakhary
Copy link
Contributor Author

Ah right, I remember now. So the issue is a bit more complex. There are more scenarios this can go bad.
of course the classic one is, Basic follower should probably also listen for item updated notification to update itself in that case as well. (I mean the Followers mediator should do it, and call updates on item update) which as far as I remember it should do, so maybe it bugs there.

But besides that.
The basic follower class that uses dimension component to know size of item, and it put's rectangle starting from x, y + dimensions multiplied by scale. now this is not always right, for example when things are on minus coordinates of composite, it will not be included in rectangle, unless we shift them all. And also basic follower should behave differently when it's a polygon. But that's totally another topic.

@azakhary
Copy link
Contributor Author

So this, FollowersUIMediator.java listens to ITEM_DATA_UPDATED which is fine. Now somehow I guess when you edit composite and go up, this does not happen beacause while you are inside composite the follower for parent composite doesnot yet exist, and when you go one step up it auto sets, if I remember correctly, maybe somewhere there it should update. I am not sure in exact steps to reproduce, but I hope this helps.

@InnerScript
Copy link

@azakhary

I'm working on fixing similar issues with polygon editing. (this might get fixed along the way, too)

I was hoping you could share with me where the transform and dimensions components are rendered. Also, for polygons (basic primitives) where the color fill is rendered (currently I have the outlines working, but the color fill sometimes detaches)

@azakhary
Copy link
Contributor Author

well the components don't get "rendered" what happens is, each item type, has it's own "Draw" logic:
https://github.com/UnderwaterApps/overlap2d-runtime-libgdx/tree/master/src/com/uwsoft/editor/renderer/systems/render/logic

the polygon's are currently just a modifiers of simple images, so thei get rendered in textureregion rendering logic at this moment. Each render logic can take any component from the mappers in order to know what and how to render.

@Sasun
Copy link
Collaborator

Sasun commented May 6, 2016

issues fixed

@Sasun Sasun closed this as completed May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants