GRID_HELPER: Allow grid disable
Many items require precise, non-grid movement. Adding the ability to flag a non-grid option will permit this behavior. This is a required precursor commit to fixing lp:1738818 and lp:1771683
This commit is contained in:
parent
f56b5cf7bd
commit
28c19cb613
|
@ -48,6 +48,7 @@ GRID_HELPER::GRID_HELPER( PCB_BASE_FRAME* aFrame ) :
|
|||
{
|
||||
m_diagonalAuxAxesEnable = true;
|
||||
m_enableSnap = true;
|
||||
m_enableGrid = true;
|
||||
m_snapSize = 100;
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
|
||||
|
@ -121,6 +122,9 @@ void GRID_HELPER::SetAuxAxes( bool aEnable, const VECTOR2I& aOrigin, bool aEnabl
|
|||
|
||||
VECTOR2I GRID_HELPER::Align( const VECTOR2I& aPoint ) const
|
||||
{
|
||||
if( !m_enableGrid )
|
||||
return aPoint;
|
||||
|
||||
const VECTOR2D gridOffset( GetOrigin() );
|
||||
const VECTOR2D gridSize( GetGrid() );
|
||||
|
||||
|
|
|
@ -64,6 +64,11 @@ public:
|
|||
m_enableSnap = aSnap;
|
||||
}
|
||||
|
||||
void SetUseGrid( bool aGrid = true )
|
||||
{
|
||||
m_enableGrid = aGrid;
|
||||
}
|
||||
|
||||
private:
|
||||
enum ANCHOR_FLAGS {
|
||||
CORNER = 0x1,
|
||||
|
@ -110,6 +115,7 @@ private:
|
|||
|
||||
bool m_diagonalAuxAxesEnable; ///< If true, use the aux axis for snapping as well
|
||||
bool m_enableSnap; ///< If true, allow snapping to other items on the layers
|
||||
bool m_enableGrid; ///< If true, allow snapping to grid
|
||||
int m_snapSize; ///< Sets the radius in screen units for snapping to items
|
||||
|
||||
KIGFX::ORIGIN_VIEWITEM m_viewSnapPoint;
|
||||
|
|
Loading…
Reference in New Issue