-static inline vec2d rectangle_mid(rectangle const *r) {
- vec2d v = { fixed_point_add(r->pos.x, fixed_point_div(r->extent.x, FIXED_POINT(2, 0))),
- fixed_point_add(r->pos.y, fixed_point_div(r->extent.y, FIXED_POINT(2, 0)))
- };
- return v;
-}
+static inline fixed_point rectangle_mid_x (rectangle const *r) { return fixed_point_add(r->pos.x, fixed_point_div(r->extent.x, FIXED_INT(2))); }
+static inline fixed_point rectangle_mid_y (rectangle const *r) { return fixed_point_add(r->pos.y, fixed_point_div(r->extent.y, FIXED_INT(2))); }
+
+static inline vec2d rectangle_mid (rectangle const *r) { vec2d v = { rectangle_mid_x(r), rectangle_mid_y(r) }; return v; }
+
+static inline void rectangle_move_to (rectangle *r, vec2d new_pos) { r->pos = new_pos; }
+static inline void rectangle_move_to_x(rectangle *r, fixed_point new_x ) { r->pos.x = new_x; }
+static inline void rectangle_move_to_y(rectangle *r, fixed_point new_y ) { r->pos.x = new_y; }