Procházet zdrojové kódy

fix clipping on rotated objects when culling is enabled
also fixes culling objects which disapear when overlapping the the far right
thx @ JanWosnitza

Michael E Craggs před 8 roky
rodič
revize
54942ed7fe
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      oxygine/src/Actor.cpp

+ 7 - 1
oxygine/src/Actor.cpp

@@ -1502,7 +1502,13 @@ namespace oxygine
         tl = tr.transform(tl);
         br = tr.transform(br);
 
-        Vector2 size = br - tl;
+        Vector2 size = Vector2(
+			abs(br.x - tl.x),
+			abs(br.y - tl.y));
+
+        Vector2 ntl;
+		ntl.x = std::min(tl.x, br.x);
+		ntl.y = std::min(tl.y, br.y);
 
         return RectF(tl, size);
     }