Permalink
Browse files

Merge pull request #599 from CandyFace/fix-opacity

Removed division from opacity and set feather to 1
  • Loading branch information...
2 parents 80b5185 + 0312a12 commit 8c1a738be27f29edf29390618b35e14c5970479c @chchwy chchwy committed on GitHub Feb 12, 2017
Showing with 8 additions and 4 deletions.
  1. +2 −2 core_lib/interface/scribblearea.cpp
  2. +6 −2 core_lib/tool/penciltool.cpp
@@ -1066,7 +1066,7 @@ void ScribbleArea::drawPen( QPointF thePoint, qreal brushWidth, QColor fillColou
qreal offset = 64;
QRadialGradient radialGrad( thePoint, 0.5 * brushWidth );
- setGaussianGradient( radialGrad, fillColour, opacity/2, offset );
+ setGaussianGradient( radialGrad, fillColour, opacity, offset );
QRectF rectangle( thePoint.x() - 0.5 * brushWidth, thePoint.y() - 0.5 * brushWidth, brushWidth, brushWidth );
@@ -1076,7 +1076,7 @@ void ScribbleArea::drawPen( QPointF thePoint, qreal brushWidth, QColor fillColou
void ScribbleArea::drawPencil( QPointF thePoint, qreal brushWidth, QColor fillColour, qreal opacity )
{
- drawBrush(thePoint, brushWidth, 50, fillColour, opacity / 5);
+ drawBrush(thePoint, brushWidth, 50, fillColour, opacity);
}
void ScribbleArea::drawBrush( QPointF thePoint, qreal brushWidth, qreal mOffset, QColor fillColour, qreal opacity, bool usingFeather )
@@ -28,7 +28,7 @@ void PencilTool::loadSettings()
QSettings settings( PENCIL2D, PENCIL2D );
properties.width = settings.value( "pencilWidth" ).toDouble();
- properties.feather = 50;
+ properties.feather = 1;
properties.pressure = settings.value( "pencilPressure" ).toBool();
properties.invisibility = 1;
properties.preserveAlpha = 0;
@@ -202,7 +202,11 @@ void PencilTool::drawStroke()
if ( layer->type() == Layer::BITMAP )
{
- qreal opacity = mCurrentPressure * mCurrentPressure;
+ qreal opacity = 1.0f;
+ if (properties.pressure == true)
+ {
+ opacity = mCurrentPressure / 2;
+ }
mCurrentWidth = properties.width * mCurrentPressure;
qreal brushWidth = mCurrentWidth;

0 comments on commit 8c1a738

Please sign in to comment.