X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/9ae835c864d2b3e651a86ac4af7cfac0979f136a..0e142e7a8d04db5ceaa41a866f67ef6f92fcd189:/badge/util/rectangle.h diff --git a/badge/util/rectangle.h b/badge/util/rectangle.h index 4fe5c0e..70d43ba 100644 --- a/badge/util/rectangle.h +++ b/badge/util/rectangle.h @@ -13,7 +13,14 @@ static inline vec2d vec2d_add(vec2d v1, vec2d v2) { fixed_point_add(v1.x, v2.x), fixed_point_add(v1.y, v2.y) }; + return r; +} +static inline vec2d vec2d_sub(vec2d v1, vec2d v2) { + vec2d r = { + fixed_point_sub(v1.x, v2.x), + fixed_point_sub(v1.y, v2.y) + }; return r; }