dermetfan / libgdx-texturepacker-gui

Automatically exported from code.google.com/p/libgdx-texturepacker-gui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

maxWidth is not loaded from settings file correctly.

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. Load the GUI
2. Set max width and max height to 2048
3. Export the settings
4. Import the settings again

What is the expected output? What do you see instead?
Expected output is for the maxWidth to be loaded from the file and set to 2048. 
Instead maxWidth reverts to the default of 512. maxHeight is correctly loaded 
and is set to 2048.

What version of the product are you using? On what operating system?
Latest. Win 7.

Please provide any additional information below.
I believe this is a bug in the AppContext class.


On line 94 of AppContext maxHeight is read correctly. It sets the match object 
to look for a number:

m = Pattern.compile("maxHeight=(\\d+)").matcher(ln.trim());
if (m.find()) settings.maxHeight = Integer.valueOf(m.group(1));



On line 96 of AppContext the match object is set to look for a boolean:

m = Pattern.compile("maxWidth=(true|false)").matcher(ln.trim());
if (m.find()) settings.maxWidth = Integer.valueOf(m.group(1));

This should be changed to look for a number, the same way maxHeight is loaded.



The same problem is repeated for minHeight and minWidth:

m = Pattern.compile("minHeight=(true|false)").matcher(ln.trim());
if (m.find()) settings.minHeight = Integer.valueOf(m.group(1));

m = Pattern.compile("minWidth=(true|false)").matcher(ln.trim());
if (m.find()) settings.minWidth = Integer.valueOf(m.group(1));


Original issue reported on code.google.com by matty...@gmail.com on 21 Jun 2011 at 12:30

Original comment by aurelien.ribon on 5 Aug 2011 at 8:53

  • Changed state: Fixed