Skip to content

Commit

Permalink
ticket:4476 Handle gradients properly for SVG export.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Aug 17, 2017
1 parent 829f2ca commit 16b485f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions OMEdit/OMEditGUI/Annotations/ShapeAnnotation.cpp
Expand Up @@ -528,24 +528,23 @@ void ShapeAnnotation::applyFillPattern(QPainter *painter)
QRadialGradient radialGradient;
switch (mFillPattern) {
case StringHandler::FillHorizontalCylinder:
linearGradient = QLinearGradient(boundingRectangle.center().x(), boundingRectangle.center().y(), boundingRectangle.center().x(), boundingRectangle.y());
linearGradient.setColorAt(0.0, mFillColor);
linearGradient = QLinearGradient(boundingRectangle.center().x(), boundingRectangle.top(), boundingRectangle.center().x(), boundingRectangle.bottom());
linearGradient.setColorAt(0.0, mLineColor);
linearGradient.setColorAt(0.5, mFillColor);
linearGradient.setColorAt(1.0, mLineColor);
linearGradient.setSpread(QGradient::ReflectSpread);
painter->setBrush(linearGradient);
break;
case StringHandler::FillVerticalCylinder:
linearGradient = QLinearGradient(boundingRectangle.center().x(), boundingRectangle.center().y(), boundingRectangle.x(), boundingRectangle.center().y());
linearGradient.setColorAt(0.0, mFillColor);
linearGradient = QLinearGradient(boundingRectangle.left(), boundingRectangle.center().y(), boundingRectangle.right(), boundingRectangle.center().y());
linearGradient.setColorAt(0.0, mLineColor);
linearGradient.setColorAt(0.5, mFillColor);
linearGradient.setColorAt(1.0, mLineColor);
linearGradient.setSpread(QGradient::ReflectSpread);
painter->setBrush(linearGradient);
break;
case StringHandler::FillSphere:
radialGradient = QRadialGradient(boundingRectangle.center().x(), boundingRectangle.center().y(), boundingRectangle.width());
radialGradient.setColorAt(0.0, mFillColor);
radialGradient.setColorAt(1.0, mLineColor);
//radialGradient.setSpread(QGradient::ReflectSpread);
painter->setBrush(radialGradient);
break;
case StringHandler::FillSolid:
Expand Down

0 comments on commit 16b485f

Please sign in to comment.