diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-03-06 06:31:33 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-03-06 06:31:33 +0000 |
| commit | 998e601fb0de79b7617fa9402eb36537041663c6 (patch) | |
| tree | 7cfdef36123bbd82fe1ba8e2a37638eb87b4dc8b /src/sp-gradient.cpp | |
| parent | Now webslicer-create-group respects the grouping hierarchy (diff) | |
| download | inkscape-998e601fb0de79b7617fa9402eb36537041663c6.tar.gz inkscape-998e601fb0de79b7617fa9402eb36537041663c6.zip | |
New tab in Fill&Stroke dialog for swatch fills.
(bzr r9153)
Diffstat (limited to '')
| -rw-r--r-- | src/sp-gradient.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp index 3fd120fb3..fb16e9e5a 100644 --- a/src/sp-gradient.cpp +++ b/src/sp-gradient.cpp @@ -638,19 +638,27 @@ sp_gradient_modified(SPObject *object, guint flags) } } - -bool SPGradient::isSolid() const +SPStop* SPGradient::getFirstStop() { - bool solid = false; - if ( SP_GRADIENT_HAS_STOPS(this) && (sp_number_of_stops(this) == 0) ) { - gchar const * attr = repr->attribute("osb:paint"); - if (attr && !strcmp(attr, "solid")) { - solid = true; + SPStop* first = 0; + for (SPObject *ochild = sp_object_first_child(this); ochild && !first; ochild = SP_OBJECT_NEXT(ochild)) { + if (SP_IS_STOP(ochild)) { + first = SP_STOP(ochild); } } - return solid; + return first; } +int SPGradient::getStopCount() const +{ + int count = 0; + + for (SPStop *stop = const_cast<SPGradient*>(this)->getFirstStop(); stop && sp_next_stop(stop); stop = sp_next_stop(stop)) { + count++; + } + + return count; +} /** * Write gradient attributes to repr. |
