diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-03-23 06:35:55 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-03-23 06:35:55 +0000 |
| commit | 20bfd4dac4ab262db7bbcb497f5bf11608c1a908 (patch) | |
| tree | d2a6157bb9c3e42aa1258d09de916644d54db7da /src/gradient-chemistry.cpp | |
| parent | Adding some const correctness and overloads. (diff) | |
| download | inkscape-20bfd4dac4ab262db7bbcb497f5bf11608c1a908.tar.gz inkscape-20bfd4dac4ab262db7bbcb497f5bf11608c1a908.zip | |
Update to reflect "swatch" gradients as being assumed to be shared.
(bzr r9224)
Diffstat (limited to 'src/gradient-chemistry.cpp')
| -rw-r--r-- | src/gradient-chemistry.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index b2e68c345..c95c1b2c5 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -190,7 +190,7 @@ sp_gradient_fork_private_if_necessary(SPGradient *gr, SPGradient *vector, // Check the number of uses of the gradient within this object; // if we are private and there are no other users, - if (SP_OBJECT_HREFCOUNT(gr) <= count_gradient_hrefs(user, gr)) { + if (!vector->isSwatch() && (SP_OBJECT_HREFCOUNT(gr) <= count_gradient_hrefs(user, gr))) { // check vector if ( gr != vector && gr->ref->getObject() != vector ) { /* our href is not the vector, and vector is different from gr; relink */ @@ -1080,10 +1080,11 @@ sp_item_set_gradient(SPItem *item, SPGradient *gr, SPGradientType type, bool is_ /* Current fill style is the gradient of the required type */ SPGradient *current = SP_GRADIENT(ps); - //g_print("hrefcount %d count %d\n", SP_OBJECT_HREFCOUNT(ig), count_gradient_hrefs(SP_OBJECT(item), ig)); + //g_message("hrefcount %d count %d\n", SP_OBJECT_HREFCOUNT(current), count_gradient_hrefs(SP_OBJECT(item), current)); - if (SP_OBJECT_HREFCOUNT(current) == 1 || - SP_OBJECT_HREFCOUNT(current) == count_gradient_hrefs(SP_OBJECT(item), current)) { + if (!current->isSwatch() + && (SP_OBJECT_HREFCOUNT(current) == 1 || + SP_OBJECT_HREFCOUNT(current) == count_gradient_hrefs(SP_OBJECT(item), current))) { // current is private and it's either used once, or all its uses are by children of item; // so just change its href to vector |
