Explorar el Código

fixed localscale hit test

dm hace 7 años
padre
commit
74b7d73201
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      oxygine/src/oxygine/actor/Sprite.cpp

+ 1 - 0
oxygine/src/oxygine/actor/Sprite.cpp

@@ -96,6 +96,7 @@ namespace oxygine
 
 
         const unsigned char* buff = ad.data;
         const unsigned char* buff = ad.data;
         Vector2 pos = localPosition * _frame.getResAnim()->getAppliedScale();
         Vector2 pos = localPosition * _frame.getResAnim()->getAppliedScale();
+        pos = pos.div(_localScale);
         Point lp = pos.cast<Point>() / HIT_TEST_DOWNSCALE;
         Point lp = pos.cast<Point>() / HIT_TEST_DOWNSCALE;
         Rect r(0, 0, ad.w, ad.h);
         Rect r(0, 0, ad.w, ad.h);
         if (r.pointIn(lp))
         if (r.pointIn(lp))