You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the CAAT JSON format generator is run with an option which generates multiple ratios, the images are correctly generated but the resulting output JSON always reflects the 1.0 ratio.
The reason is that the code which generates the dictionary to be serialised as JSON is passed a dictionary generated by BaseTextFormat#get_context(), which contains the information about the ratio adjustments for the image and each sprite, but it does not use this information.
Because the CAATFormat#get_context function is invoked once per ratio, with the ratio passed as a keyword argument, the issue can be fixed by inspecting the keyword argument and choosing the right ratio-adjusted values, or just proceeding as usual if the ratio argument isn't provided. An example of this can be seen in a pull request I submitted recently: DocLabyrinth/glue@557e6dd
The tests for the CAAT format just check that one expected key is a dictionary without checking the format or values of the generated json. It's worth making the testing more thorough when addressing this issue.
The text was updated successfully, but these errors were encountered:
When the CAAT JSON format generator is run with an option which generates multiple ratios, the images are correctly generated but the resulting output JSON always reflects the 1.0 ratio.
Command
sprites.json
[email protected] (should be twice the size)
The reason is that the code which generates the dictionary to be serialised as JSON is passed a dictionary generated by BaseTextFormat#get_context(), which contains the information about the ratio adjustments for the image and each sprite, but it does not use this information.
Because the CAATFormat#get_context function is invoked once per ratio, with the ratio passed as a keyword argument, the issue can be fixed by inspecting the keyword argument and choosing the right ratio-adjusted values, or just proceeding as usual if the ratio argument isn't provided. An example of this can be seen in a pull request I submitted recently:
DocLabyrinth/glue@557e6dd
The tests for the CAAT format just check that one expected key is a dictionary without checking the format or values of the generated json. It's worth making the testing more thorough when addressing this issue.
The text was updated successfully, but these errors were encountered: