Parcourir la source

Quick fix for controls sometimes not clearing themselves when needed.

Adam Blake il y a 13 ans
Parent
commit
674aae2da3
2 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 5 1
      gameplay/src/Container.cpp
  2. 1 1
      gameplay/src/Form.cpp

+ 5 - 1
gameplay/src/Container.cpp

@@ -325,7 +325,7 @@ void Container::update(const Control* container, const Vector2& offset)
 
 void Container::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needsClear, float targetHeight)
 {
-    if (_skin && needsClear)
+    if (needsClear)
     {
         GL_ASSERT( glEnable(GL_SCISSOR_TEST) );
         GL_ASSERT( glClearColor(0, 0, 0, 0) );
@@ -337,6 +337,10 @@ void Container::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needs
 
         needsClear = false;
     }
+    else
+    {
+        needsClear = true;
+    }
 
     spriteBatch->begin();
     Control::drawBorder(spriteBatch, clip);

+ 1 - 1
gameplay/src/Form.cpp

@@ -451,7 +451,7 @@ void Form::draw()
 
         GP_ASSERT(_theme);
         _theme->setProjectionMatrix(_projectionMatrix);
-        Container::draw(_theme->getSpriteBatch(), Rectangle(0, 0, _bounds.width, _bounds.height), _skin == NULL, _bounds.height);
+        Container::draw(_theme->getSpriteBatch(), Rectangle(0, 0, _bounds.width, _bounds.height), _skin != NULL, _bounds.height);
         _theme->setProjectionMatrix(_defaultProjectionMatrix);
 
         // Rebind the default framebuffer and game viewport.