Fix GH Issue 49 Clip artifact
This commit is contained in:
parent
222492c912
commit
aa8fea7ba4
|
@ -59,8 +59,6 @@
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
void _debugRect(char* text, QRectF r);
|
|
||||||
|
|
||||||
QGIView::QGIView()
|
QGIView::QGIView()
|
||||||
:QGraphicsItemGroup(),
|
:QGraphicsItemGroup(),
|
||||||
locked(false),
|
locked(false),
|
||||||
|
@ -298,12 +296,14 @@ void QGIView::draw()
|
||||||
|
|
||||||
void QGIView::drawBorder()
|
void QGIView::drawBorder()
|
||||||
{
|
{
|
||||||
|
prepareGeometryChange();
|
||||||
if (!borderVisible) {
|
if (!borderVisible) {
|
||||||
|
m_label->hide();
|
||||||
|
m_border->hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//double margin = 2.0;
|
//double margin = 2.0;
|
||||||
prepareGeometryChange();
|
|
||||||
m_label->hide();
|
m_label->hide();
|
||||||
m_border->hide();
|
m_border->hide();
|
||||||
|
|
||||||
|
@ -350,10 +350,6 @@ void QGIView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
|
||||||
QStyleOptionGraphicsItem myOption(*option);
|
QStyleOptionGraphicsItem myOption(*option);
|
||||||
myOption.state &= ~QStyle::State_Selected;
|
myOption.state &= ~QStyle::State_Selected;
|
||||||
|
|
||||||
if(!borderVisible){
|
|
||||||
m_label->hide();
|
|
||||||
m_border->hide();
|
|
||||||
}
|
|
||||||
QGraphicsItemGroup::paint(painter, &myOption, widget);
|
QGraphicsItemGroup::paint(painter, &myOption, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,6 +373,7 @@ QRectF QGIView::boundingRect() const
|
||||||
{
|
{
|
||||||
return m_border->rect().adjusted(-2.,-2.,2.,2.); //allow for border line width //TODO: fiddle brect if border off?
|
return m_border->rect().adjusted(-2.,-2.,2.,2.); //allow for border line width //TODO: fiddle brect if border off?
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor QGIView::getNormalColor()
|
QColor QGIView::getNormalColor()
|
||||||
{
|
{
|
||||||
Base::Reference<ParameterGrp> hGrp = getParmGroupCol();
|
Base::Reference<ParameterGrp> hGrp = getParmGroupCol();
|
||||||
|
@ -419,7 +416,7 @@ QString QGIView::getPrefFont()
|
||||||
return QString::fromStdString(fontName);
|
return QString::fromStdString(fontName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _debugRect(char* text, QRectF r) {
|
void QGIView::dumpRect(char* text, QRectF r) {
|
||||||
Base::Console().Message("TRACE - %s - rect: (%.3f,%.3f) x (%.3f,%.3f)\n",text,
|
Base::Console().Message("DUMP - %s - rect: (%.3f,%.3f) x (%.3f,%.3f)\n",text,
|
||||||
r.left(),r.top(),r.right(),r.bottom());
|
r.left(),r.top(),r.right(),r.bottom());
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,6 @@ public:
|
||||||
virtual void updateView(bool update = false);
|
virtual void updateView(bool update = false);
|
||||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
|
||||||
virtual QRectF boundingRect() const override;
|
virtual QRectF boundingRect() const override;
|
||||||
//virtual QPainterPath shape(void) const;
|
|
||||||
|
|
||||||
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
|
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
|
||||||
|
|
||||||
|
@ -89,6 +88,7 @@ protected:
|
||||||
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||||
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||||
virtual QRectF customChildrenBoundingRect(void);
|
virtual QRectF customChildrenBoundingRect(void);
|
||||||
|
void dumpRect(char* text, QRectF r);
|
||||||
|
|
||||||
QColor getNormalColor(void);
|
QColor getNormalColor(void);
|
||||||
QColor getPreColor(void);
|
QColor getPreColor(void);
|
||||||
|
@ -117,6 +117,6 @@ protected:
|
||||||
QPen m_decorPen;
|
QPen m_decorPen;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace MDIViewPageGui
|
} // namespace
|
||||||
|
|
||||||
#endif // DRAWINGGUI_QGRAPHICSITEMVIEW_H
|
#endif // DRAWINGGUI_QGRAPHICSITEMVIEW_H
|
||||||
|
|
|
@ -138,6 +138,7 @@ void QGIViewClip::drawClip()
|
||||||
//TODO: why is qgiv never already in a group?
|
//TODO: why is qgiv never already in a group?
|
||||||
if (qgiv->group() != m_cliparea) {
|
if (qgiv->group() != m_cliparea) {
|
||||||
qgiv->hide();
|
qgiv->hide();
|
||||||
|
scene()->removeItem(qgiv);
|
||||||
m_cliparea->addToGroup(qgiv);
|
m_cliparea->addToGroup(qgiv);
|
||||||
qgiv->isInnerView(true);
|
qgiv->isInnerView(true);
|
||||||
double x = qgiv->getViewObject()->X.getValue();
|
double x = qgiv->getViewObject()->X.getValue();
|
||||||
|
@ -172,6 +173,7 @@ void QGIViewClip::drawClip()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: at least move to QGIView
|
||||||
QGIView* QGIViewClip::getQGIVByName(std::string name) //should probably be method in MDIViewPage?? but qgiv can't get drawingView? or QGVPage!
|
QGIView* QGIViewClip::getQGIVByName(std::string name) //should probably be method in MDIViewPage?? but qgiv can't get drawingView? or QGVPage!
|
||||||
{
|
{
|
||||||
QList<QGraphicsItem*> qgItems = scene()->items();
|
QList<QGraphicsItem*> qgItems = scene()->items();
|
||||||
|
|
|
@ -272,7 +272,6 @@ void QGIViewPart::updateView(bool update)
|
||||||
void QGIViewPart::draw() {
|
void QGIViewPart::draw() {
|
||||||
drawViewPart();
|
drawViewPart();
|
||||||
drawBorder();
|
drawBorder();
|
||||||
QGIView::draw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGIViewPart::drawViewPart()
|
void QGIViewPart::drawViewPart()
|
||||||
|
@ -595,3 +594,8 @@ void QGIViewPart::dumpPath(const char* text,QPainterPath path)
|
||||||
elem.type,typeName,elem.x,elem.y,elem.isMoveTo(),elem.isLineTo(),elem.isCurveTo());
|
elem.type,typeName,elem.x,elem.y,elem.isMoveTo(),elem.isLineTo(),elem.isCurveTo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QRectF QGIViewPart::boundingRect() const
|
||||||
|
{
|
||||||
|
return childrenBoundingRect();
|
||||||
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include <Base/Parameter.h>
|
#include <Base/Parameter.h>
|
||||||
#include <Mod/TechDraw/App/Geometry.h>
|
#include <Mod/TechDraw/App/Geometry.h>
|
||||||
|
#include "QGCustomBorder.h"
|
||||||
#include "QGIView.h"
|
#include "QGIView.h"
|
||||||
|
|
||||||
namespace TechDraw {
|
namespace TechDraw {
|
||||||
|
@ -56,6 +57,7 @@ public:
|
||||||
void setViewPartFeature(TechDraw::DrawViewPart *obj);
|
void setViewPartFeature(TechDraw::DrawViewPart *obj);
|
||||||
virtual void updateView(bool update = false) override;
|
virtual void updateView(bool update = false) override;
|
||||||
void tidy();
|
void tidy();
|
||||||
|
virtual QRectF boundingRect() const override;
|
||||||
|
|
||||||
virtual void draw() override;
|
virtual void draw() override;
|
||||||
|
|
||||||
|
@ -90,6 +92,6 @@ private:
|
||||||
QList<QGraphicsItem*> deleteItems;
|
QList<QGraphicsItem*> deleteItems;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace MDIViewPageGui
|
} // namespace
|
||||||
|
|
||||||
#endif // DRAWINGGUI_QGRAPHICSITEMVIEWPART_H
|
#endif // DRAWINGGUI_QGRAPHICSITEMVIEWPART_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user