gree / lwf

LWF - Lightweight SWF
http://gree.github.com/lwf/
zlib License
627 stars 167 forks source link

C++: Fix movie bounds calculation #119

Closed filwag closed 9 years ago

filwag commented 9 years ago
  1. Fixed scope typo that was probably done when porting HTML5 changes to C++ core (in 9cbcf53). Pay attention to the indentation here: https://github.com/gree/lwf/blob/master/coffee/core/lwf_movie.coffee#L835-843. Because of this issue, RequestCalculateBounds + GetBounds pattern was always returning {0, 0, 0, 0}.
  2. FLT_MIN actually returns "minimum normalised positive floating-point number" (http://stackoverflow.com/a/7973776) but we actually want to have the smallest negative float instead. This issue led to incorrect bounds calculation when both min and max bound coordinates are negative. HTML5 core has similar code: https://github.com/gree/lwf/blob/master/coffee/core/lwf_movie.coffee#L820-L823
splhack commented 9 years ago

good catches! thanks!