diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-01-14 08:13:09 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-01-14 08:13:09 +0000 |
| commit | 7f7da4643d6909af5cd58b2f24846774e3af509b (patch) | |
| tree | 1fec13b3616ecc90fb251bb9e643aefc43c80c43 /src/desktop-style.cpp | |
| parent | Some additional docs (diff) | |
| parent | Initial cut of disabling floating windows on window managers with problems. (diff) | |
| download | inkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.tar.gz inkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.zip | |
* Merge from trunk
* Update to new snapping API
* Modify the join action slightly
(bzr r8846.2.11)
Diffstat (limited to 'src/desktop-style.cpp')
| -rw-r--r-- | src/desktop-style.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index c8782051b..2afcd6109 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -44,6 +44,7 @@ #include "desktop-style.h" #include "svg/svg-icc-color.h" +#include "svg/svg-device-color.h" #include "box3d-side.h" /** @@ -432,6 +433,8 @@ objects_query_fillstroke (GSList *objects, SPStyle *style_res, bool const isfill paint_res->set = TRUE; SVGICCColor* iccColor = 0; + SVGDeviceColor* devColor = 0; + bool iccSeen = false; gfloat c[4]; c[0] = c[1] = c[2] = c[3] = 0.0; @@ -529,6 +532,23 @@ objects_query_fillstroke (GSList *objects, SPStyle *style_res, bool const isfill c[1] += d[1]; c[2] += d[2]; c[3] += SP_SCALE24_TO_FLOAT (isfill? style->fill_opacity.value : style->stroke_opacity.value); + + // average device color + unsigned int it; + if (i==objects /*if this is the first object in the GList*/ + && paint->value.color.device){ + devColor = new SVGDeviceColor(*paint->value.color.device); + for (it=0; it < paint->value.color.device->colors.size(); it++){ + devColor->colors[it] = 0; + } + } + + if (devColor && paint->value.color.device && paint->value.color.device->type == devColor->type){ + for (it=0; it < paint->value.color.device->colors.size(); it++){ + devColor->colors[it] += paint->value.color.device->colors[it]; + } + } + num ++; } @@ -568,6 +588,14 @@ objects_query_fillstroke (GSList *objects, SPStyle *style_res, bool const isfill paint_res->value.color.icc = tmp; } + // divide and store the device-color + if (devColor){ + for (unsigned int it=0; it < devColor->colors.size(); it++){ + devColor->colors[it] /= num; + } + paint_res->value.color.device = devColor; + } + if (num > 1) { if (same_color) return QUERY_STYLE_MULTIPLE_SAME; |
