Filled aristo tool brush.

preferencesAboutTextFull
Yimgo 12 years ago
parent 3d8301cc0c
commit d64c87a920
  1. 1
      src/board/UBBoardView.cpp
  2. 13
      src/tools/UBGraphicsAristo.cpp
  3. 2
      src/tools/UBGraphicsAristo.h

@ -59,6 +59,7 @@
#include "tools/UBGraphicsCache.h"
#include "tools/UBGraphicsTriangle.h"
#include "tools/UBGraphicsProtractor.h"
#include "tools/UBGraphicsAristo.h"
#include "core/memcheck.h"

@ -132,7 +132,7 @@ void UBGraphicsAristo::paint(QPainter *painter, const QStyleOptionGraphicsItem *
{
QPolygonF polygon;
painter->setBrush(Qt::NoBrush);
painter->setBrush(fillBrush());
painter->setPen(drawColor());
polygon << A << B << C;
@ -390,6 +390,17 @@ void UBGraphicsAristo::paintProtractorGraduations(QPainter* painter)
painter->restore();
}
QBrush UBGraphicsAristo::fillBrush() const
{
QColor fillColor = edgeFillColor();// scene()->isDarkBackground() ? sDarkBackgroundFillColor : sFillColor;
QColor fillColorCenter = middleFillColor();//scene()->isDarkBackground() ? sDarkBackgroundFillColorCenter : sFillColorCenter;
QColor transparentWhite = Qt::white;
transparentWhite.setAlpha(scene()->isDarkBackground() ? sDrawTransparency : sFillTransparency);
QRadialGradient radialGradient(rect().center(), radius(), rect().center());
radialGradient.setColorAt(0, fillColorCenter);
radialGradient.setColorAt(1, fillColor);
return radialGradient;
}
void UBGraphicsAristo::rotateAroundCenter(qreal angle)
{

@ -147,7 +147,7 @@ class UBGraphicsAristo : public UBAbstractDrawRuler, public QGraphicsPolygonItem
{
return sqrt(((B.x() - A.x())*(B.x() - A.x()))+((B.y() - A.y())*(B.y() - A.y()))) * 9 / 16 - 20;
}
QBrush fillBrush() const;
UBGraphicsAristoOrientation mOrientation;

Loading…
Cancel
Save