From be18b3457f1b5c1205cdd45eae0a8a19b9c3e7b3 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 9 Mar 2010 02:12:09 -0800 Subject: Initial F&S dialog setting of swatch colors. (bzr r9169) --- src/sp-paint-server.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/sp-paint-server.cpp') diff --git a/src/sp-paint-server.cpp b/src/sp-paint-server.cpp index 805aafaea..258323a93 100644 --- a/src/sp-paint-server.cpp +++ b/src/sp-paint-server.cpp @@ -157,8 +157,17 @@ static void sp_painter_stale_fill(SPPainter */*painter*/, NRPixBlock *pb) bool SPPaintServer::isSwatch() const { - // Temporary for now. Later expand to more - return isSolid(); + bool swatch = false; + if (SP_IS_GRADIENT(this)) { + SPGradient *grad = SP_GRADIENT(this); + if ( SP_GRADIENT_HAS_STOPS(grad) ) { + gchar const * attr = repr->attribute("osb:paint"); + if (attr && !strcmp(attr, "solid")) { + swatch = true; + } + } + } + return swatch; } bool SPPaintServer::isSolid() const -- cgit v1.2.3