| 2150 | //----------------------------------------------------------------------------- |
| 2151 | |
| 2152 | void GuiEditCtrl::doSnapping( const GuiEvent& event, const RectI& selectionBounds, Point2I& delta ) |
| 2153 | { |
| 2154 | // Clear snapping. If we have snapping on, we want to find a new best snap. |
| 2155 | |
| 2156 | mSnapped[ SnapVertical ] = false; |
| 2157 | mSnapped[ SnapHorizontal ] = false; |
| 2158 | |
| 2159 | // Compute global bounds. |
| 2160 | |
| 2161 | RectI selectionBoundsGlobal = selectionBounds; |
| 2162 | selectionBoundsGlobal.point = getContentControl()->localToGlobalCoord( selectionBoundsGlobal.point ); |
| 2163 | |
| 2164 | // Apply the snaps. |
| 2165 | |
| 2166 | doGridSnap( event, selectionBounds, selectionBoundsGlobal, delta ); |
| 2167 | doGuideSnap( event, selectionBounds, selectionBoundsGlobal, delta ); |
| 2168 | doControlSnap( event, selectionBounds, selectionBoundsGlobal, delta ); |
| 2169 | |
| 2170 | // If we have a horizontal snap, compute a delta. |
| 2171 | |
| 2172 | if( mSnapped[ SnapVertical ] ) |
| 2173 | snapDelta( SnapVertical, mSnapEdge[ SnapVertical ], mSnapOffset[ SnapVertical ], selectionBoundsGlobal, delta ); |
| 2174 | |
| 2175 | // If we have a vertical snap, compute a delta. |
| 2176 | |
| 2177 | if( mSnapped[ SnapHorizontal ] ) |
| 2178 | snapDelta( SnapHorizontal, mSnapEdge[ SnapHorizontal ], mSnapOffset[ SnapHorizontal ], selectionBoundsGlobal, delta ); |
| 2179 | } |
| 2180 | |
| 2181 | //----------------------------------------------------------------------------- |
| 2182 |
nothing calls this directly
no test coverage detected