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

Bug in colourFromString #4

Closed
pedro-w opened this issue Dec 31, 2016 · 1 comment
Closed

Bug in colourFromString #4

pedro-w opened this issue Dec 31, 2016 · 1 comment

Comments

@pedro-w
Copy link

pedro-w commented Dec 31, 2016

I am getting 'not a valid colour string' errors when loading a map. Tiled is saving the background colour like this '#ffffff' and the line here converts it to 'fffffff' i.e. a seven character string.

One solution is to write that line as

str.erase (std::remove(str.begin(), str.end(), '#'), str.end());

(as discussed here)

I am using MacOS. It may be that other versions of the C++ library do not cause this issue but I don't think that can be relied on according to the standard.

@fallahn
Copy link
Owner

fallahn commented Dec 31, 2016

Would have used your fix as it is neater, but I already had this sitting here, had just forgotten to commit!

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

No branches or pull requests

2 participants