| 2163 | //----------------------------------------------------------------------------- |
| 2164 | |
| 2165 | void GuiEditCtrl::doSnapping( const GuiEvent& event, const RectI& selectionBounds, Point2I& delta ) |
| 2166 | { |
| 2167 | // Clear snapping. If we have snapping on, we want to find a new best snap. |
| 2168 | |
| 2169 | mSnapped[ SnapVertical ] = false; |
| 2170 | mSnapped[ SnapHorizontal ] = false; |
| 2171 | |
| 2172 | // Compute global bounds. |
| 2173 | |
| 2174 | RectI selectionBoundsGlobal = selectionBounds; |
| 2175 | selectionBoundsGlobal.point = getContentControl()->localToGlobalCoord( selectionBoundsGlobal.point ); |
| 2176 | |
| 2177 | // Apply the snaps. |
| 2178 | |
| 2179 | doGridSnap( event, selectionBounds, selectionBoundsGlobal, delta ); |
| 2180 | doGuideSnap( event, selectionBounds, selectionBoundsGlobal, delta ); |
| 2181 | doControlSnap( event, selectionBounds, selectionBoundsGlobal, delta ); |
| 2182 | |
| 2183 | // If we have a horizontal snap, compute a delta. |
| 2184 | |
| 2185 | if( mSnapped[ SnapVertical ] ) |
| 2186 | snapDelta( SnapVertical, mSnapEdge[ SnapVertical ], mSnapOffset[ SnapVertical ], selectionBoundsGlobal, delta ); |
| 2187 | |
| 2188 | // If we have a vertical snap, compute a delta. |
| 2189 | |
| 2190 | if( mSnapped[ SnapHorizontal ] ) |
| 2191 | snapDelta( SnapHorizontal, mSnapEdge[ SnapHorizontal ], mSnapOffset[ SnapHorizontal ], selectionBoundsGlobal, delta ); |
| 2192 | } |
| 2193 | |
| 2194 | //----------------------------------------------------------------------------- |
| 2195 |
nothing calls this directly
no test coverage detected