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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user