Make Edge Selection Area Adjustable
- Edges may be difficult to select depending on drawing scale and zoom level. - Parameter: Preferences/Mod/TechDraw/General/EdgeFuzz
This commit is contained in:
committed by
Yorik van Havre
parent
ac15cda1d4
commit
7b4bc50e5c
@@ -93,6 +93,15 @@ Qt::PenStyle QGIEdge::getHiddenStyle()
|
||||
return hidStyle;
|
||||
}
|
||||
|
||||
double QGIEdge::getEdgeFuzz(void) const
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
|
||||
GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
|
||||
double result = hGrp->GetFloat("EdgeFuzz",10.0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
QRectF QGIEdge::boundingRect() const
|
||||
{
|
||||
return shape().controlPointRect();
|
||||
@@ -102,7 +111,7 @@ QPainterPath QGIEdge::shape() const
|
||||
{
|
||||
QPainterPath outline;
|
||||
QPainterPathStroker stroker;
|
||||
stroker.setWidth(2.0);
|
||||
stroker.setWidth(getEdgeFuzz());
|
||||
outline = stroker.createStroke(path());
|
||||
return outline;
|
||||
}
|
||||
@@ -111,5 +120,7 @@ void QGIEdge::paint ( QPainter * painter, const QStyleOptionGraphicsItem * optio
|
||||
QStyleOptionGraphicsItem myOption(*option);
|
||||
myOption.state &= ~QStyle::State_Selected;
|
||||
|
||||
//~ painter->drawRect(boundingRect()); //good for debugging
|
||||
|
||||
QGIPrimPath::paint (painter, &myOption, widget);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
void setSmoothEdge(bool b) { isSmoothEdge = b; }
|
||||
bool getSmoothEdge() { return(isSmoothEdge); }
|
||||
virtual void setPrettyNormal() override;
|
||||
|
||||
double getEdgeFuzz(void) const;
|
||||
|
||||
protected:
|
||||
int projIndex; //index of edge in Projection. must exist.
|
||||
|
||||
Reference in New Issue
Block a user