diff options
| author | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-09 11:38:22 +0000 |
|---|---|---|
| committer | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-09 11:38:22 +0000 |
| commit | db85d12f8c106586a0b11f60bf32cdb8ca75d8f2 (patch) | |
| tree | ae5cbc2ad4fdbb93dbc1d7fc8b92ee2e2012e853 /src/widgets/paint-selector.cpp | |
| parent | renamed SPPattern methods to match coding style (diff) | |
| parent | fix crash introduces by recent rev when clipping (diff) | |
| download | inkscape-db85d12f8c106586a0b11f60bf32cdb8ca75d8f2.tar.gz inkscape-db85d12f8c106586a0b11f60bf32cdb8ca75d8f2.zip | |
merged trunk
(bzr r14059.1.21)
Diffstat (limited to 'src/widgets/paint-selector.cpp')
| -rw-r--r-- | src/widgets/paint-selector.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index e2483343f..3b191b2f3 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -34,6 +34,7 @@ #include "sp-linear-gradient.h" #include "sp-radial-gradient.h" #include "sp-mesh.h" +#include "sp-stop.h" /* fixme: Move it from dialogs to here */ #include "gradient-selector.h" #include <inkscape.h> @@ -665,6 +666,18 @@ static void sp_paint_selector_set_mode_color(SPPaintSelector *psel, SPPaintSelec { using Inkscape::UI::Widget::ColorNotebook; + if ((psel->mode == SPPaintSelector::MODE_SWATCH) + || (psel->mode == SPPaintSelector::MODE_GRADIENT_LINEAR) + || (psel->mode == SPPaintSelector::MODE_GRADIENT_RADIAL) ) { + SPGradientSelector *gsel = getGradientFromData(psel); + if (gsel) { + SPGradient *gradient = gsel->getVector(); + SPColor color = gradient->getFirstStop()->specified_color; + float alpha = gradient->getFirstStop()->opacity; + psel->selected_color->setColorAlpha(color, alpha); + } + } + sp_paint_selector_set_style_buttons(psel, psel->solid); gtk_widget_set_sensitive(psel->style, TRUE); |
