ToggleGridSnap command (beware of it)

git-svn-id: svn://svn.icculus.org/netradiant/trunk@401 61c419a2-8eb2-4b30-bcec-8cead039b335
This commit is contained in:
divverent
2009-10-04 19:15:55 +00:00
parent da366187d6
commit 04a61593c3
9 changed files with 57 additions and 27 deletions

View File

@@ -105,6 +105,8 @@ template<typename Element, typename OtherElement>
inline Element float_snapped(const Element& f, const OtherElement& snap)
{
//return Element(float_to_integer(f / snap) * snap);
if(snap == 0)
return f;
return Element(llrint(f / snap) * snap); // llrint has more significant bits
}