DragonBones / DragonBonesAS

DragonBones ActionScript Runtime
MIT License
250 stars 117 forks source link

Specification wrong for bendPositive ? #75

Closed T1mL3arn closed 8 years ago

T1mL3arn commented 8 years ago

In spec (https://github.com/DragonBones/DragonBonesAS/blob/master/docs/DragonBones%204.5%20%E6%95%B0%E6%8D%AE%E6%A0%BC%E5%BC%8F%E6%A0%87%E5%87%86%E8%AF%B4%E6%98%8E.md)

"bendPositive": true,

but in exported json file it is in quotes:

"bendPositive": "false",

Is possible to work with both, but which way is right?

akdcl commented 8 years ago

default bendPositive is true

T1mL3arn commented 8 years ago

Issue about quotes, not default values. JSON parser can parse true or false as boolean values. But parser interprets "true" or "false" as string, so is need extra code to convert string into boolean. In spec bendPositive is real bool. But in exported json (DB Pro 4.6.1) it is string. Is it a spec mistake or a bug with DB Pro export?

akdcl commented 8 years ago

Yes, it's DB Pro export bug, but in runtime it is convert string into boolean. https://github.com/DragonBones/DragonBonesAS/blob/dev/DragonBones/src/dragonBones/parsers/ObjectDataParser.as#L51-L65

T1mL3arn commented 8 years ago

Thanks for clarification!