make gradient parsing a bit more robust
authorMatthias Braun <matze@braunis.de>
Sun, 3 Apr 2005 16:54:00 +0000 (16:54 +0000)
committerMatthias Braun <matze@braunis.de>
Sun, 3 Apr 2005 16:54:00 +0000 (16:54 +0000)
SVN-Revision: 2318

src/object/background.cpp

index 50b01d0..b03b05f 100644 (file)
@@ -39,12 +39,12 @@ Background::Background(const lisp::Lisp& reader)
   if(reader.get("image", imagefile) 
       && reader.get("speed", speed)) {
     set_image(imagefile, speed);
+  } else {
+    std::vector <unsigned int> bkgd_top_color, bkgd_bottom_color;
+    if(reader.get_vector("top_color", bkgd_top_color) &&
+        reader.get_vector("bottom_color", bkgd_bottom_color))
+      set_gradient(Color(bkgd_top_color), Color(bkgd_bottom_color));
   }
-
-  std::vector <unsigned int> bkgd_top_color, bkgd_bottom_color;
-  if(reader.get_vector("top_color", bkgd_top_color) &&
-     reader.get_vector("bottom_color", bkgd_bottom_color))
-    set_gradient(Color(bkgd_top_color), Color(bkgd_bottom_color));
 }
 
 Background::~Background()