On Fri, May 01, 2015 at 10:24:17PM -0700, insaner wrote:
just to make sure that everything is ok.
Thanks for doing this! I didn't test the patch, but quick patch review and some cosmetics to fix:
=== modified file 'src/widgets/paint-selector.cpp' --- src/widgets/paint-selector.cpp 2015-03-01 08:57:53 +0000 +++ src/widgets/paint-selector.cpp 2015-05-01 06:25:57 +0000 @@ -39,6 +39,7 @@ #include "sp-linear-gradient.h" #include "sp-radial-gradient.h" #include "sp-mesh.h" +#include "sp-stop.h" // NOTE: insano added
No need for the NOTE. We can figure out who added it via bzr.
/* fixme: Move it from dialogs to here */ #include "gradient-selector.h" #include <inkscape.h> @@ -662,6 +663,20 @@ static void sp_paint_selector_set_mode_color(SPPaintSelector *psel, SPPaintSelector::Mode /*mode*/) { GtkWidget *csel;
- SPColor newcolor = psel->color;
There's an extra space after the equals
- float newalpha = psel->alpha;
- 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();
newcolor = gradient->getFirstStop()->specified_color;
Extra space here too
newalpha = gradient->getFirstStop()->opacity;
}
- }
sp_paint_selector_set_style_buttons(psel, psel->solid); gtk_widget_set_sensitive(psel->style, TRUE);
@@ -697,7 +712,8 @@ psel->selector = vb;
/* Set color */
SP_COLOR_SELECTOR( csel )->base->setColorAlpha( psel->color, psel->alpha );
// SP_COLOR_SELECTOR( csel )->base->setColorAlpha( psel->color, psel->alpha );
Don't comment out the old code, just delete it. If someone's curious they can see the original code via VCS.
SP_COLOR_SELECTOR( csel )->base->setColorAlpha( newcolor, newalpha ); // NOTE: insano added
No note needed here either.
All pretty bikesheddy of me. Technically everything looks fine to me although again I didn't test it so will defer to Josh or others to give a thumbs' up.
Thanks again for working on this, it'll be great to fix this quirky swatch behavior!
Bryce