Commit 0442f67e authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Add anti-aliasing to the shapes.

The jaggies were starting to annoy me.

Might make the pixmap into a image later just so we can have proper transparency.
parent 8aef9fe6
......@@ -323,9 +323,9 @@ QPixmap KisVisualColorSelectorShape::getPixmap()
if (m_d->pixmapsNeedUpdate == true) {
m_d->pixmapsNeedUpdate = false;
m_d->gradient = QPixmap(width(), height());
m_d->gradient.fill(Qt::black);
m_d->gradient.fill(Qt::transparent);
QImage img(width(), height(), QImage::Format_RGB32);
img.fill(Qt::black);
img.fill(Qt::transparent);;
for (int y = 0; y<img.height(); y++) {
for (int x=0; x<img.width(); x++) {
......@@ -989,7 +989,19 @@ void KisVisualEllipticalSelectorShape::drawCursor()
QPainter painter;
painter.begin(&fullSelector);
painter.setRenderHint(QPainter::Antialiasing);
//QPainterPath path;
painter.save();
//painter.setCompositionMode(QPainter::CompositionMode_Clear);
QPen pen;
pen.setColor(this->palette().background().color());
pen.setWidth(5);
painter.setPen(pen);
painter.drawEllipse(this->geometry());
if (getDimensions()==KisVisualColorSelectorShape::onedimensional) {
painter.drawEllipse(QRect(this->geometry().top()+m_barWidth, this->geometry().left()+m_barWidth, this->geometry().width()-(m_barWidth*2), this->geometry().height()-(m_barWidth*2)));
}
painter.restore();
QBrush fill;
fill.setStyle(Qt::SolidPattern);
......@@ -1128,6 +1140,16 @@ void KisVisualTriangleSelectorShape::drawCursor()
QPainter painter;
painter.begin(&fullSelector);
painter.setRenderHint(QPainter::Antialiasing);
painter.save();
//painter.setCompositionMode(QPainter::CompositionMode_Clear);
QPen pen;
pen.setColor(this->palette().background().color());
pen.setWidth(5);
painter.setPen(pen);
painter.drawPolygon(m_triangle);
painter.restore();
//QPainterPath path;
QBrush fill;
fill.setStyle(Qt::SolidPattern);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment