Code

Limit things to single-color gradients until we get gradient previews going
authorjoncruz <joncruz@users.sourceforge.net>
Wed, 18 Mar 2009 09:08:09 +0000 (09:08 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Wed, 18 Mar 2009 09:08:09 +0000 (09:08 +0000)
src/ui/dialog/swatches.cpp

index 89bdd4c3c2eed368924057698743140cb675cb5b..8fb811e3d205448dc2693c8a5287e07e8d1843ce 100644 (file)
@@ -1154,12 +1154,18 @@ void SwatchesPanel::_handleGradientsChange()
                     if ((first.offset <0.0001) && (static_cast<int>(second.offset * 100.0f) == 100)) {
                         SPColor color = first.color;
                         guint32 together = color.toRGBA32(0);
-                        Glib::ustring name((*it)->id);
-                        unsigned int r = SP_RGBA32_R_U(together);
-                        unsigned int g = SP_RGBA32_G_U(together);
-                        unsigned int b = SP_RGBA32_B_U(together);
-                        ColorItem* item = new ColorItem( r, g, b, name );
-                        docPalette->_colors.push_back(item);
+
+                        // Pick only single-color gradients for now
+                        SPColor color2 = second.color;
+                        guint32 together2 = color2.toRGBA32(0);
+                        if ( together == together2 ) {
+                            Glib::ustring name((*it)->id);
+                            unsigned int r = SP_RGBA32_R_U(together);
+                            unsigned int g = SP_RGBA32_G_U(together);
+                            unsigned int b = SP_RGBA32_B_U(together);
+                            ColorItem* item = new ColorItem( r, g, b, name );
+                            docPalette->_colors.push_back(item);
+                        }
                     }
                 }
             }