Added width calculation like in the original PyTMX implementation.