From 2187178552a02e09ab59424de3436af68ba72fa6 Mon Sep 17 00:00:00 2001 From: joncruz Date: Wed, 18 Mar 2009 09:08:09 +0000 Subject: [PATCH] Limit things to single-color gradients until we get gradient previews going --- src/ui/dialog/swatches.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 89bdd4c3c..8fb811e3d 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -1154,12 +1154,18 @@ void SwatchesPanel::_handleGradientsChange() if ((first.offset <0.0001) && (static_cast(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); + } } } } -- 2.30.2