[TD]remove white matting around detail view
This commit is contained in:
@@ -35,17 +35,16 @@
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Parameter.h>
|
||||
|
||||
#include "PreferencesGui.h"
|
||||
#include "QGCustomRect.h"
|
||||
#include <Mod/TechDraw/App/Preferences.h>
|
||||
#include <Mod/TechDraw/App/LineGroup.h>
|
||||
|
||||
#include "Rez.h"
|
||||
#include "ZVALUE.h"
|
||||
#include "QGIMatting.h"
|
||||
|
||||
using namespace TechDrawGui;
|
||||
|
||||
QGIMatting::QGIMatting() :
|
||||
m_height(10.0),
|
||||
m_width(10.0),
|
||||
//m_holeStyle(0),
|
||||
m_radius(5.0)
|
||||
|
||||
{
|
||||
@@ -54,26 +53,14 @@ QGIMatting::QGIMatting() :
|
||||
setFlag(QGraphicsItem::ItemIsSelectable, false);
|
||||
setFlag(QGraphicsItem::ItemIsMovable, false);
|
||||
|
||||
m_mat = new QGraphicsPathItem();
|
||||
addToGroup(m_mat);
|
||||
m_border = new QGraphicsPathItem();
|
||||
addToGroup(m_border);
|
||||
|
||||
m_pen.setColor(Qt::white);
|
||||
// m_pen.setColor(Qt::black);
|
||||
// m_pen.setStyle(Qt::DashLine);
|
||||
m_brush.setColor(Qt::white);
|
||||
// m_brush.setColor(Qt::black);
|
||||
m_brush.setStyle(Qt::SolidPattern);
|
||||
// m_brush.setStyle(Qt::CrossPattern);
|
||||
// m_brush.setStyle(Qt::NoBrush);
|
||||
m_penB.setColor(Qt::black);
|
||||
m_brushB.setStyle(Qt::NoBrush);
|
||||
m_pen.setColor(Qt::black);
|
||||
m_brush.setStyle(Qt::NoBrush);
|
||||
|
||||
m_mat->setPen(m_pen);
|
||||
m_mat->setBrush(m_brush);
|
||||
m_border->setPen(m_penB);
|
||||
m_border->setBrush(m_brushB);
|
||||
m_border->setPen(m_pen);
|
||||
m_border->setBrush(m_brush);
|
||||
|
||||
setZValue(ZVALUE::MATTING);
|
||||
}
|
||||
@@ -81,12 +68,6 @@ QGIMatting::QGIMatting() :
|
||||
void QGIMatting::draw()
|
||||
{
|
||||
prepareGeometryChange();
|
||||
double radiusFudge = 1.2; //keep slightly larger than fudge in App/DVDetail (1.1) to prevent bleed through
|
||||
m_width = m_radius * radiusFudge;
|
||||
m_height = m_radius * radiusFudge;
|
||||
QRectF outline(-m_width, -m_height, 2.0 * m_width, 2.0 * m_height);
|
||||
QPainterPath ppOut;
|
||||
ppOut.addRect(outline);
|
||||
QPainterPath ppCut;
|
||||
if (getHoleStyle() == 0) {
|
||||
QRectF roundCutout (-m_radius, -m_radius, 2.0 * m_radius, 2.0 * m_radius);
|
||||
@@ -96,10 +77,9 @@ void QGIMatting::draw()
|
||||
QRectF squareCutout (-squareSize, -squareSize, 2.0 * squareSize, 2.0 * squareSize);
|
||||
ppCut.addRect(squareCutout);
|
||||
}
|
||||
ppOut.addPath(ppCut);
|
||||
m_mat->setPath(ppOut);
|
||||
m_pen.setWidthF(Rez::guiX(TechDraw::LineGroup::getDefaultWidth("Graphic")));
|
||||
m_border->setPen(m_pen);
|
||||
m_border->setPath(ppCut);
|
||||
m_mat->setZValue(ZVALUE::MATTING);
|
||||
m_border->setZValue(ZVALUE::MATTING);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
#include <QGraphicsItem>
|
||||
#include <QGraphicsItemGroup>
|
||||
#include <QGraphicsPathItem>
|
||||
#include <QPen>
|
||||
#include <QBrush>
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPainter;
|
||||
@@ -58,21 +61,14 @@ public:
|
||||
protected:
|
||||
double m_height;
|
||||
double m_width;
|
||||
//int m_holeStyle; //round or rect
|
||||
double m_radius;
|
||||
int getHoleStyle();
|
||||
|
||||
QGraphicsPathItem* m_mat;
|
||||
QGraphicsPathItem* m_border;
|
||||
|
||||
// QPainterPath m_perimeter;
|
||||
// QPainterPath m_cutout;
|
||||
|
||||
private:
|
||||
QPen m_pen;
|
||||
QBrush m_brush;
|
||||
QPen m_penB;
|
||||
QBrush m_brushB;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user