Browse Source

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 8 years ago
parent
commit
659d2a85c5
1 changed files with 8 additions and 2 deletions
  1. 8 2
      oxygine/src/Actor.cpp

+ 8 - 2
oxygine/src/Actor.cpp

@@ -1502,9 +1502,15 @@ 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));
 
-        return RectF(tl, size);
+        Vector2 ntl;
+		ntl.x = std::min(tl.x, br.x);
+		ntl.y = std::min(tl.y, br.y);
+
+        return RectF(ntl, size);
     }