Forráskód Böngészése

Merge pull request #755 from ablake/next

A couple UI fixes.
Sean Paul Taylor 13 éve
szülő
commit
8067280311

+ 1 - 1
gameplay/.cproject

@@ -466,4 +466,4 @@
 	</storageModule>
 	</storageModule>
 	<storageModule moduleId="com.qnx.tools.ide.qde.core.QNXProjectProperties"/>
 	<storageModule moduleId="com.qnx.tools.ide.qde.core.QNXProjectProperties"/>
 	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
 	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
-</cproject>
+</cproject>

+ 3 - 3
gameplay/src/Control.cpp

@@ -1035,9 +1035,6 @@ void Control::drawText(const Rectangle& position)
 
 
 void Control::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needsClear, bool cleared, float targetHeight)
 void Control::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needsClear, bool cleared, float targetHeight)
 {
 {
-    if (!_visible)
-        return;
-
     if (needsClear)
     if (needsClear)
     {
     {
         GL_ASSERT( glEnable(GL_SCISSOR_TEST) );
         GL_ASSERT( glEnable(GL_SCISSOR_TEST) );
@@ -1046,6 +1043,9 @@ void Control::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needsCl
         GL_ASSERT( glDisable(GL_SCISSOR_TEST) );
         GL_ASSERT( glDisable(GL_SCISSOR_TEST) );
     }
     }
 
 
+    if (!_visible)
+        return;
+
     spriteBatch->start();
     spriteBatch->start();
     drawBorder(spriteBatch, clip);
     drawBorder(spriteBatch, clip);
     drawImages(spriteBatch, clip);
     drawImages(spriteBatch, clip);

+ 2 - 1
gameplay/src/Form.cpp

@@ -546,7 +546,8 @@ void Form::draw()
 
 
         GP_ASSERT(_theme);
         GP_ASSERT(_theme);
         _theme->setProjectionMatrix(_projectionMatrix);
         _theme->setProjectionMatrix(_projectionMatrix);
-        Container::draw(_theme->getSpriteBatch(), Rectangle(0, 0, _bounds.width, _bounds.height),  true/*WAS _skin!=NULL*/, false, _bounds.height);
+        Container::draw(_theme->getSpriteBatch(), Rectangle(0, 0, _bounds.width, _bounds.height),
+                        _skin != NULL, false, _bounds.height);
         _theme->setProjectionMatrix(_defaultProjectionMatrix);
         _theme->setProjectionMatrix(_defaultProjectionMatrix);
 
 
         // restore the previous game viewport
         // restore the previous game viewport

+ 3 - 3
gameplay/src/Layout.cpp

@@ -49,7 +49,7 @@ void Layout::align(Control* control, const Container* container)
         // Vertical alignment
         // Vertical alignment
         if ((control->_alignment & Control::ALIGN_BOTTOM) == Control::ALIGN_BOTTOM)
         if ((control->_alignment & Control::ALIGN_BOTTOM) == Control::ALIGN_BOTTOM)
         {
         {
-            controlBounds.y = clipHeight - controlBounds.height;
+            controlBounds.y = clipHeight - controlBounds.height - controlMargin.bottom;
         }
         }
         else if ((control->_alignment & Control::ALIGN_VCENTER) == Control::ALIGN_VCENTER)
         else if ((control->_alignment & Control::ALIGN_VCENTER) == Control::ALIGN_VCENTER)
         {
         {
@@ -57,7 +57,7 @@ void Layout::align(Control* control, const Container* container)
         }
         }
         else if ((control->_alignment & Control::ALIGN_TOP) == Control::ALIGN_TOP)
         else if ((control->_alignment & Control::ALIGN_TOP) == Control::ALIGN_TOP)
         {
         {
-            controlBounds.y = 0;
+            controlBounds.y = controlMargin.top;
         }
         }
 
 
         // Horizontal alignment
         // Horizontal alignment
@@ -71,7 +71,7 @@ void Layout::align(Control* control, const Container* container)
         }
         }
         else if ((control->_alignment & Control::ALIGN_LEFT) == Control::ALIGN_LEFT)
         else if ((control->_alignment & Control::ALIGN_LEFT) == Control::ALIGN_LEFT)
         {
         {
-            controlBounds.x = 0;
+            controlBounds.x = controlMargin.left;
         }
         }
 
 
         control->setBounds(controlBounds);
         control->setBounds(controlBounds);