summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2009-03-18 09:08:09 +0000
committerjoncruz <joncruz@users.sourceforge.net>2009-03-18 09:08:09 +0000
commit5db7426ec8a1b517406bf0f4f1e7d82b36c0dec1 (patch)
tree5ddb1bda11d028d47e64b85b584ed64cd944b2bc /src
parentPurged use of INKSCAPE_PIXMAPDIR (diff)
downloadinkscape-5db7426ec8a1b517406bf0f4f1e7d82b36c0dec1.tar.gz
inkscape-5db7426ec8a1b517406bf0f4f1e7d82b36c0dec1.zip
Limit things to single-color gradients until we get gradient previews going
(bzr r7516)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/swatches.cpp18
1 files 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<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);
+ }
}
}
}