Jelajahi Sumber

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

Darryl Gough 13 tahun lalu
induk
melakukan
c0328f3d49
1 mengubah file dengan 1 tambahan dan 2 penghapusan
  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)
 {
-    if (_state == ACTIVE || _state == FOCUS)
+    if (_caretImage && (_state == ACTIVE || _state == FOCUS))
     {
         // Draw the cursor at its current location.
-        GP_ASSERT(_caretImage);
         const Rectangle& region = _caretImage->getRegion();
         if (!region.isEmpty())
         {