r16464 by jghali - #9856: Frequent ""Unable to find the requested color..." error in colorwheel widget
scribus-commit
scribus-commit at lists.scribus.net
Sun Mar 20 13:49:14 CET 2011
Author: jghali
Date: Sun Mar 20 12:49:13 2011
New Revision: 16464
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16464
Log:
#9856: Frequent ""Unable to find the requested color..." error in colorwheel widget
Modified:
trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp
Modified: trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16464&path=/trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp (original)
+++ trunk/Scribus/scribus/plugins/colorwheel/colorwheelwidget.cpp Sun Mar 20 12:49:13 2011
@@ -311,19 +311,19 @@
QColor act(ScColorEngine::getRGBColor(actualColor, currentDoc));
c.getHsv(&origh, &origs, &origv);
- for (it = colorMap.begin(); it != colorMap.end(); ++it)
+ angle = origh + angleShift;
+ if (angle > 359)
+ angle -= 360;
+ if (colorMap.contains(angle))
{
int tmph, tmps, tmpv;
- QColor col(ScColorEngine::getRGBColor(it.value(), currentDoc));
+ QColor col(ScColorEngine::getRGBColor(colorMap[angle], currentDoc));
col.getHsv(&tmph, &tmps, &tmpv);
- if (origh == tmph)
- {
- act.setHsv(tmph, origs, origv);
- actualColor.fromQColor(act);
- actualColor = ScColorEngine::convertToModel(actualColor, currentDoc, currentColorSpace);
- baseAngle = it.key();
- return true;
- }
+ act.setHsv(tmph , origs, origv);
+ actualColor.fromQColor(act);
+ actualColor = ScColorEngine::convertToModel(actualColor, currentDoc, currentColorSpace);
+ baseAngle = angle;
+ return true;
}
return false;
}
More information about the scribus-commit
mailing list