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

Changed TextBox so that it doesn't assert on _caretImage.
Fixed #578

Darryl Gough 13 éve
szülő
commit
c0328f3d49
1 módosított fájl, 1 hozzáadás és 2 törlés
  1. 1 2
      gameplay/src/TextBox.cpp

+ 1 - 2
gameplay/src/TextBox.cpp

@@ -329,10 +329,9 @@ void TextBox::update(const Control* container, const Vector2& offset)
 
 
 void TextBox::drawImages(SpriteBatch* spriteBatch, const Rectangle& clip)
 void TextBox::drawImages(SpriteBatch* spriteBatch, const Rectangle& clip)
 {
 {
-    if (_state == ACTIVE || _state == FOCUS)
+    if (_caretImage && (_state == ACTIVE || _state == FOCUS))
     {
     {
         // Draw the cursor at its current location.
         // Draw the cursor at its current location.
-        GP_ASSERT(_caretImage);
         const Rectangle& region = _caretImage->getRegion();
         const Rectangle& region = _caretImage->getRegion();
         if (!region.isEmpty())
         if (!region.isEmpty())
         {
         {