dm 7 years ago
parent
commit
b23ab59efd

+ 15 - 10
oxygine/src/oxygine/actor/Actor.cpp

@@ -142,20 +142,25 @@ namespace oxygine
     {
     }
 
-    void Actor::calcBounds2(RectF& bounds, const Transform& transform) const
+    void Actor::calcChildrenBounds(RectF& bounds, const Transform& transform) const
     {
-        if (!(_flags & flag_boundsNoChildren))
+        const Actor* c = getFirstChild().get();
+        while (c)
         {
-            const Actor* c = getFirstChild().get();
-            while (c)
+            if (c->getVisible())
             {
-                if (c->getVisible())
-                {
-                    Transform tr = c->getTransform() * transform;
-                    c->calcBounds2(bounds, tr);
-                }
-                c = c->getNextSibling().get();
+                Transform tr = c->getTransform() * transform;
+                c->calcBounds2(bounds, tr);
             }
+            c = c->getNextSibling().get();
+        }
+    }
+
+    void Actor::calcBounds2(RectF& bounds, const Transform& transform) const
+    {
+        if (!(_flags & flag_boundsNoChildren))
+        {
+            calcChildrenBounds(bounds, transform);
         }
 
         RectF rect;

+ 1 - 0
oxygine/src/oxygine/actor/Actor.h

@@ -304,6 +304,7 @@ namespace oxygine
         virtual void transformUpdated();
 
         virtual void calcBounds2(RectF& bounds, const Transform& transform) const;
+        void calcChildrenBounds(RectF& bounds, const Transform& transform) const;
 
 
         typedef intrusive_list<spActor> children;

+ 13 - 0
oxygine/src/oxygine/closure/closure_impl.h

@@ -97,6 +97,19 @@ struct Closure<R(PARAM_TYPE_LIST)>: public detail::CLOSURE_NUM::ClosureBase<R PA
 	  this->p_proxy = callfunction;
   }
 
+  /*
+  Closure(const std::function< void(void)>& f_)
+  {
+      auto f = [f_](Event*) {
+          f_();
+      };
+      
+      this->p_function = std::make_shared< std::function<R(PARAM_TYPE_LIST)> >(f);
+      this->p_this = this->p_function.get();
+      this->p_proxy = callfunction;
+  }
+  */
+
   template<class T>
   Closure(T f)//lambda support
   {