3d cam: DragNewBrush: improve big grid handling

This commit is contained in:
Garux 2018-06-08 21:30:38 +03:00
parent aff5c8093e
commit f51000c0d0

View File

@ -3704,7 +3704,7 @@ void testSelect( const View& view, const Matrix4& pivot2world ){
else{
const Vector3 near = vector4_projected( matrix4_transformed_vector4( test.getScreen2world(), Vector4( 0, 0, -1, 1 ) ) );
const Vector3 far = vector4_projected( matrix4_transformed_vector4( test.getScreen2world(), Vector4( 0, 0, 1, 1 ) ) );
start = vector3_normalised( far - near ) * ( 256.f + GetGridSize() ) + near;
start = vector3_normalised( far - near ) * ( 256.f + GetGridSize() * sqrt( 3.0 ) ) + near;
}
vector3_snap( start, GetSnapGridSize() );
m_dragNewBrush.set0( start );