r20191 by fschmid - Allow full range of Lab colors for HLC

scribus-commit scribus-commit at lists.scribus.net
Mon Jun 22 18:01:56 UTC 2015


Author: fschmid
Date: Mon Jun 22 18:01:56 2015
New Revision: 20191

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20191
Log:
Allow full range of Lab colors for HLC

Modified:
    trunk/Scribus/scribus/ui/cmykfw.cpp
    trunk/Scribus/scribus/ui/colorchart.cpp

Modified: trunk/Scribus/scribus/ui/cmykfw.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20191&path=/trunk/Scribus/scribus/ui/cmykfw.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cmykfw.cpp (original)
+++ trunk/Scribus/scribus/ui/cmykfw.cpp Mon Jun 22 18:01:56 2015
@@ -281,15 +281,14 @@
 	disconnect( MagentaSL, SIGNAL( valueChanged(int) ), this, SLOT( setColor() ) );
 	disconnect( YellowSL, SIGNAL( valueChanged(int) ), this, SLOT( setColor() ) );
 	disconnect( BlackSL, SIGNAL( valueChanged(int) ), this, SLOT( setColor() ) );
-	int val = qRound(value);
 	if (CyanSp == sender())
-		CyanSL->setValue(val * 1000);
+		CyanSL->setValue(value * 1000);
 	if (MagentaSp == sender())
-		MagentaSL->setValue(val * 1000);
+		MagentaSL->setValue(value * 1000);
 	if (YellowSp == sender())
-		YellowSL->setValue(val * 1000);
+		YellowSL->setValue(value * 1000);
 	if (BlackSp == sender())
-		BlackSL->setValue(val * 1000);
+		BlackSL->setValue(value * 1000);
 	connect( CyanSL, SIGNAL( valueChanged(int) ), this, SLOT( setColor() ) );
 	connect( MagentaSL, SIGNAL( valueChanged(int) ), this, SLOT( setColor() ) );
 	connect( YellowSL, SIGNAL( valueChanged(int) ), this, SLOT( setColor() ) );
@@ -663,7 +662,6 @@
 		YellowSL->setPalette(sliderPix(60));
 		BlackSL->setPalette(sliderBlack());
 		ColorMap->drawMode = 0;
-		ColorMap->setFixedWidth(180);
 		setValues();
 	}
 	else if ((mod == tr("Web Safe RGB")) || (mod == tr("RGB")))
@@ -716,7 +714,6 @@
 		MagentaSL->setPalette(sliderPix(120));
 		YellowSL->setPalette(sliderPix(240));
 		ColorMap->drawMode = 0;
-		ColorMap->setFixedWidth(180);
 		setValues();
 	}
 	else if (mod == tr("Lab"))
@@ -766,7 +763,6 @@
 		YellowSL->setPalette(sliderPix(240));
 		setValues();
 		ColorMap->drawMode = 1;
-		ColorMap->setFixedWidth(180);
 		ColorMap->drawPalette(CyanSp->value() * 2.55);
 		ColorMap->setMark(MagentaSp->value(), YellowSp->value());
 	}
@@ -818,7 +814,6 @@
 		YellowSL->setPalette(sliderPix(240));
 		setValues();
 		ColorMap->drawMode = 2;
-		ColorMap->setFixedWidth(128);
 		double L, a, b;
 		Farbe.getLab(&L, &a, &b);
 		ColorMap->drawPalette(L * 2.55);

Modified: trunk/Scribus/scribus/ui/colorchart.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20191&path=/trunk/Scribus/scribus/ui/colorchart.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorchart.cpp (original)
+++ trunk/Scribus/scribus/ui/colorchart.cpp Mon Jun 22 18:01:56 2015
@@ -53,17 +53,7 @@
 {
 	drawMark(m->x(), m->y());
 	if (drawMode > 0)
-	{
-		if (drawMode == 2)
-		{
-			QPainterPath clp;
-			clp.addEllipse(0, 0, width(), height());
-			if (clp.contains(QPointF(m->x(), m->y())))
-				emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
-		}
-		else
-			emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
-	}
+		emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
 	else
 		emit ColorVal(m->x() * 359 / width(), m->y() * 255 / height(), true);
 }
@@ -72,17 +62,7 @@
 {
 	drawMark(m->x(), m->y());
 	if (drawMode > 0)
-	{
-		if (drawMode == 2)
-		{
-			QPainterPath clp;
-			clp.addEllipse(0, 0, width(), height());
-			if (clp.contains(QPointF(m->x(), m->y())))
-				emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
-		}
-		else
-			emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
-	}
+		emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
 	else
 		emit ColorVal(m->x() * 359 / width(), m->y() * 255 / height(), true);
 }
@@ -91,17 +71,7 @@
 {
 	drawMark(m->x(), m->y());
 	if (drawMode > 0)
-	{
-		if (drawMode == 2)
-		{
-			QPainterPath clp;
-			clp.addEllipse(0, 0, width(), height());
-			if (clp.contains(QPointF(m->x(), m->y())))
-				emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
-		}
-		else
-			emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
-	}
+		emit ColorVal(m->x() * 256 / width() - 128, 256 - (m->y() * 256 / height()) - 128, true);
 	else
 		emit ColorVal(m->x() * 359 / width(), m->y() * 255 / height(), true);
 }
@@ -114,13 +84,6 @@
 	p.setClipRect(e->rect());
 	QImage tmp = QImage(width(), height(), QImage::Format_ARGB32_Premultiplied);
 	p2.begin(&tmp);
-	p2.fillRect(QRect(0, 0, width(), height()), palette().background());
-	if (drawMode == 2)
-	{
-		QPainterPath clp;
-		clp.addEllipse(0, 0, width(), height());
-		p2.setClipPath(clp);
-	}
 	p2.drawPixmap(0, 0, pmx);
 	if (doDrawMark)
 	{




More information about the scribus-commit mailing list