Fix Selection center marks

- CenterMarks were difficult to select due to small
  pick radius.  Pick radius is now an adjustable
  parameter.
This commit is contained in:
wandererfan
2019-02-21 14:18:45 -05:00
committed by wmayer
parent c940081de1
commit 8b8f96b930
2 changed files with 28 additions and 0 deletions

View File

@@ -87,3 +87,26 @@ void QGICMark::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QGIVertex::paint (painter, &myOption, widget);
}
QRectF QGICMark::boundingRect() const
{
return shape().controlPointRect();
}
QPainterPath QGICMark::shape() const
{
QPainterPath outline;
QPainterPathStroker stroker;
stroker.setWidth(getMarkFuzz());
outline = stroker.createStroke(path());
return outline;
}
double QGICMark::getMarkFuzz(void) const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double result = hGrp->GetFloat("MarkFuzz",20.0);
return result;
}

View File

@@ -38,6 +38,9 @@ public:
int type() const { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual QRectF boundingRect() const override;
virtual QPainterPath shape() const override;
int getProjIndex() const { return projIndex; }
void draw(void);
@@ -47,6 +50,8 @@ public:
void setThick(float t);
virtual void setPrettyNormal();
double getMarkFuzz(void) const;
protected:
int projIndex;
QColor getCMarkColor();