extent: fix double negative for contraction

This commit is contained in:
Danny Robson 2015-09-22 17:23:54 +10:00
parent a83aa188e4
commit b58dd7a880
2 changed files with 9 additions and 4 deletions

View File

@ -99,7 +99,7 @@ template <size_t S, typename T>
extent<S,T>
extent<S,T>::contracted (T t) const
{
return *this - vector<S,T> {-t};
return *this - vector<S,T> {t};
}

View File

@ -5,7 +5,12 @@ int
main (void)
{
util::TAP::logger tap;
util::extent2f instance;
(void) instance;
tap.todo ("instancing test");
{
util::extent2u hi { 8, 4 };
util::extent2u lo { 6, 2 };
tap.expect_eq (lo, hi.contracted (2), "extent scalar contraction by value");
}
return tap.status ();
}