diff --git a/ChangeLog b/ChangeLog index 4d9c2ff92..892ebed30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-04 Emmanuele Bassi + + * clutter.symbols: Add clutter_actor_move_byu() + + * clutter/clutter-actor.h: + * clutter/clutter-actor.c: + (clutter_actor_move_by), + (clutter_actor_move_byu): Add a units-based variant of the + clutter_actor_move_by() function + 2008-01-02 Johan Bilien reviewed by: Emmanuele Bassi diff --git a/clutter.symbols b/clutter.symbols index 8e82a8102..e170ec1b7 100644 --- a/clutter.symbols +++ b/clutter.symbols @@ -37,6 +37,7 @@ clutter_actor_hide_all clutter_actor_lower clutter_actor_lower_bottom clutter_actor_move_by +clutter_actor_move_byu clutter_actor_paint clutter_actor_pick clutter_actor_query_coords diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 934781b6a..0928a6b85 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -2220,7 +2220,7 @@ clutter_actor_set_positionu (ClutterActor *self, } /** - * clutter_actor_move_by + * clutter_actor_move_by: * @self: A #ClutterActor * @dx: Distance to move Actor on X axis. * @dy: Distance to move Actor on Y axis. @@ -2234,19 +2234,39 @@ void clutter_actor_move_by (ClutterActor *self, gint dx, gint dy) +{ + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + clutter_actor_move_byu (self, + CLUTTER_UNITS_FROM_DEVICE (dx), + CLUTTER_UNITS_FROM_DEVICE (dy)); +} + +/** + * clutter_actor_move_byu: + * @self: A #ClutterActor + * @dx: Distance to move Actor on X axis, in #ClutterUnits. + * @dy: Distance to move Actor on Y axis, in #ClutterUnits. + * + * Moves an actor by specified distance relative to the current position. + * + * Since: 0.6 + */ +void +clutter_actor_move_byu (ClutterActor *self, + ClutterUnit dx, + ClutterUnit dy) { ClutterActorBox box; - gint32 dxu = CLUTTER_UNITS_FROM_INT (dx); - gint32 dyu = CLUTTER_UNITS_FROM_INT (dy); g_return_if_fail (CLUTTER_IS_ACTOR (self)); clutter_actor_query_coords (self, &box); - box.x2 += dxu; - box.y2 += dyu; - box.x1 += dxu; - box.y1 += dyu; + box.x2 += dx; + box.y2 += dy; + box.x1 += dx; + box.y1 += dy; clutter_actor_request_coords (self, &box); } diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h index 8b9e60bd8..413b4cf07 100644 --- a/clutter/clutter-actor.h +++ b/clutter/clutter-actor.h @@ -388,6 +388,9 @@ void clutter_actor_get_scale (ClutterActor *sel void clutter_actor_move_by (ClutterActor *self, gint dx, gint dy); +void clutter_actor_move_byu (ClutterActor *self, + ClutterUnit dx, + ClutterUnit dy); void clutter_actor_get_vertices (ClutterActor *self, ClutterVertex verts[4]); diff --git a/doc/reference/ChangeLog b/doc/reference/ChangeLog index 39aa33db7..2f144207b 100644 --- a/doc/reference/ChangeLog +++ b/doc/reference/ChangeLog @@ -1,3 +1,7 @@ +2008-01-04 Emmanuele Bassi + + * clutter-sections.txt: Add clutter_actor_move_byu() + 2007-12-24 Emmanuele Bassi * clutter-sections.txt: Add the units-based clip accessors diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index 1a4325dcb..9c1a2a647 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -386,6 +386,7 @@ clutter_actor_set_anchor_pointu clutter_actor_get_anchor_pointu clutter_actor_set_clipu clutter_actor_get_clipu +clutter_actor_move_byu clutter_actor_set_scalex