From 41ce5bce89ce18f148bbe6723183d27013e916e0 Mon Sep 17 00:00:00 2001 From: JucaBlues Date: Thu, 13 Aug 2009 04:03:19 +0000 Subject: [PATCH] preserve icc on color wheel selector --- src/widgets/sp-color-wheel-selector.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/widgets/sp-color-wheel-selector.cpp b/src/widgets/sp-color-wheel-selector.cpp index 174b071f9..bc8c4763b 100644 --- a/src/widgets/sp-color-wheel-selector.cpp +++ b/src/widgets/sp-color-wheel-selector.cpp @@ -10,7 +10,8 @@ #include "../dialogs/dialog-events.h" #include "sp-color-wheel-selector.h" #include "sp-color-scales.h" - +#include "sp-color-icc-selector.h" +#include "../svg/svg-icc-color.h" G_BEGIN_DECLS @@ -237,6 +238,10 @@ void ColorWheelSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorW wheelSelector->_updating = TRUE; + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); wheelSelector->_updating = FALSE; @@ -249,6 +254,11 @@ void ColorWheelSelector::_sliderGrabbed( SPColorSlider *slider, SPColorWheelSele if (!wheelSelector->_dragging) { wheelSelector->_dragging = TRUE; wheelSelector->_grabbed(); + + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } } @@ -260,6 +270,11 @@ void ColorWheelSelector::_sliderReleased( SPColorSlider *slider, SPColorWheelSel if (wheelSelector->_dragging) { wheelSelector->_dragging = FALSE; wheelSelector->_released(); + + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } } @@ -269,6 +284,10 @@ void ColorWheelSelector::_sliderChanged( SPColorSlider *slider, SPColorWheelSele (void)slider; ColorWheelSelector* wheelSelector = (ColorWheelSelector*)(SP_COLOR_SELECTOR(cs)->base); + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } @@ -285,6 +304,10 @@ void ColorWheelSelector::_wheelChanged( SPColorWheel *wheel, SPColorWheelSelecto sp_color_slider_set_colors (SP_COLOR_SLIDER(wheelSelector->_slider), start, mid, end); + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( color, wheelSelector->_alpha, sp_color_wheel_is_adjusting( wheel ) ); } -- 2.30.2