[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. b5056198e5469181556c59ce0c6911699b8fddcc
Eugeniy Meshcheryakov
eugen at debian.org
Wed Feb 6 20:23:36 UTC 2008
The following commit has been merged in the master branch:
commit a69e5e9f6c4da2a89a9f0127669cc882c40c2ef5
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date: Sat Jan 5 03:44:08 2008 +0100
make control points large and transparent
diff --git a/gui/controlpoint.cxx b/gui/controlpoint.cxx
index e2fe5f5..aa87ccb 100644
--- a/gui/controlpoint.cxx
+++ b/gui/controlpoint.cxx
@@ -18,6 +18,8 @@
#include <QPainter>
#include "glyphcontour.h"
+static const QRectF cpRect(-5, -5, 10, 10);
+
ControlPoint::ControlPoint(GlyphContour *contour, int pointNumber, QGraphicsItem *parent) :
QObject(), QGraphicsItem(parent), m_contour(contour), m_pointNumber(pointNumber)
{
@@ -27,7 +29,6 @@ ControlPoint::ControlPoint(GlyphContour *contour, int pointNumber, QGraphicsItem
setFlag(ItemIsMovable);
setFlag(ItemIsSelectable);
setFlag(ItemIgnoresTransformations);
- setFlag(ItemClipsToShape);
setZValue(1);
GlyphPoint pt = contour->points().at(m_pointNumber);
@@ -40,14 +41,14 @@ ControlPoint::ControlPoint(GlyphContour *contour, int pointNumber, QGraphicsItem
QRectF ControlPoint::boundingRect() const
{
- return QRectF(-3, -3, 6, 6).adjusted(-2, -2, 2, 2);
+ return cpRect.adjusted(-2, -2, 2, 2);
}
QPainterPath ControlPoint::shape() const
{
QPainterPath path;
- path.addEllipse(QRectF(-3, -3, 6, 6));
+ path.addEllipse(cpRect);
return path;
}
@@ -56,20 +57,15 @@ void ControlPoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
Q_UNUSED(option);
Q_UNUSED(widget);
- painter->setPen(Qt::NoPen);
- if (isSelected()) {
- if (!m_pointNumber)
- painter->setBrush(Qt::darkGreen);
- else
- painter->setBrush(Qt::darkYellow);
- }
- else {
- if (!m_pointNumber)
- painter->setBrush(Qt::green); // TODO make this adjustable
- else
- painter->setBrush(Qt::red);
- }
- painter->drawEllipse(QRectF(-3, -3, 6, 6));
+ if (!m_pointNumber)
+ painter->setPen(QColor(255, 128, 128, 191));
+ else
+ painter->setPen(QColor(255, 255, 255, 191));
+ if (isSelected())
+ painter->setBrush(QColor(191, 191, 86, 160));
+ else
+ painter->setBrush(QColor(191, 191, 191, 160));
+ painter->drawEllipse(cpRect);
}
QVariant ControlPoint::itemChange(GraphicsItemChange change, const QVariant &value)
--
Fondue Font Editor
More information about the fondue-commits
mailing list