Commit 8ec154a7 authored by Jochen Becher's avatar Jochen Becher
Browse files

ModelEditor: remove some commented-out code



Change-Id: Id34aa3131ba981115cef34e753e7ee8ff4eb440a
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 99bb1590
......@@ -274,18 +274,10 @@ void ClassItem::update()
bool ClassItem::intersectShapeWithLine(const QLineF &line, QPointF *intersectionPoint, QLineF *intersectionLine) const
{
QPolygonF polygon;
if (m_customIcon) {
QRectF rect = object()->rect();
// polygon = m_customIcon->path().toFillPolygon(QTransform()
// .scale(rect.width() / m_customIcon->shapeWidth(), rect.height() / m_customIcon->shapeHeight())
// .translate(object()->pos().x(), object()->pos().y()));
rect.translate(object()->pos());
polygon << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft() << rect.topLeft();
} else {
QRectF rect = object()->rect();
rect.translate(object()->pos());
polygon << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft() << rect.topLeft();
}
// TODO if m_customIcon then use that shape + label's shape as intersection path
QRectF rect = object()->rect();
rect.translate(object()->pos());
polygon << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft() << rect.topLeft();
return GeometryUtilities::intersect(polygon, line, intersectionPoint, intersectionLine);
}
......
......@@ -313,7 +313,6 @@ void ComponentItem::updateGeometry()
double left = -width / 2.0;
double right = width / 2.0;
double top = -height / 2.0;
//double bottom = height / 2.0;
double y = top;
setPos(object()->pos());
......
......@@ -208,9 +208,7 @@ void DiagramItem::updateGeometry()
// update sizes and positions
double left = -width / 2.0;
//double right = width / 2.0;
double top = -height / 2.0;
//double bottom = height / 2.0;
double y = top;
setPos(object()->pos());
......
......@@ -258,7 +258,6 @@ void ItemItem::updateGeometry()
double left = -width / 2.0;
double right = width / 2.0;
double top = -height / 2.0;
//double bottom = height / 2.0;
double y = top;
setPos(object()->pos());
......
......@@ -109,9 +109,6 @@ void CustomIconItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
painter->setPen(m_pen);
ShapePaintVisitor visitor(painter, QPointF(0.0, 0.0), QSizeF(m_stereotypeIcon.width(), m_stereotypeIcon.height()), m_baseSize, m_actualSize);
m_stereotypeIcon.iconShape().visitShapes(&visitor);
//painter->setBrush(Qt::NoBrush);
//painter->setPen(Qt::red);
//painter->drawRect(boundingRect());
painter->restore();
}
......
......@@ -46,17 +46,13 @@ DefaultStyle::DefaultStyle()
setFillBrush(QBrush(QColor("yellow")));
setExtraFillBrush(QBrush(QColor("white")));
QFont normalFont;
// TODO the standard font family is "MS Shell Dlg 2" which is not good for small fonts in diagrams
//normalFont.setFamily(QStringLiteral("ModelEditor"));
//normalFont.setPointSizeF(9.0);
// TODO use own ModelEditor font
normalFont.setPixelSize(11);
setNormalFont(normalFont);
QFont smallFont(normalFont);
//smallFont.setPointSizeF(normalFont.pointSizeF() * 0.80);
smallFont.setPixelSize(9);
setSmallFont(smallFont);
QFont headerFont(normalFont);
//headerFont.setPointSizeF(normalFont.pointSizeF() * 1.4);
headerFont.setPixelSize(16);
setHeaderFont(headerFont);
}
......
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