summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2011-12-07 14:38:09 +0000
committerJazzyNico <nicoduf@yahoo.fr>2011-12-07 14:38:09 +0000
commit466edb5fd657d34abcdf49a15bbbbd5051f6a872 (patch)
treecbdf1f43aba925623871933129b573ba592c45c1 /src
parentcppcheck (diff)
downloadinkscape-466edb5fd657d34abcdf49a15bbbbd5051f6a872.tar.gz
inkscape-466edb5fd657d34abcdf49a15bbbbd5051f6a872.zip
Colors. Patch for Bug #677081 (Default paste color opacity) by Romain.
(bzr r10761)
Diffstat (limited to 'src')
-rw-r--r--src/widgets/sp-color-notebook.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp
index 1324e0b16..c9a09349b 100644
--- a/src/widgets/sp-color-notebook.cpp
+++ b/src/widgets/sp-color-notebook.cpp
@@ -486,9 +486,14 @@ void ColorNotebook::_rgbaEntryChanged(GtkEntry* entry)
if (t) {
Glib::ustring text = t;
bool changed = false;
- if (!text.empty() && text[0] == '#') {
+
+ // Here we deal with pasted colors with theformat '#RRGGBB' or 'RRGGBB'
+ // In those cases we keep (and so add) the current alpha value.
+ if (!text.empty()) {
changed = true;
- text.erase(0,1);
+ if (text[0] == '#') {
+ text.erase(0,1);
+ }
if (text.size() == 6) {
// it was a standard RGB hex
unsigned int alph = SP_COLOR_F_TO_U(_alpha);