diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 9bafacac5..c5ce7300f 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -10258,6 +10258,43 @@ clutter_actor_get_position (ClutterActor *self, *y = clutter_actor_get_y (self); } +/** + * clutter_actor_get_fixed_position: + * @self: a #ClutterActor + * @x: (out) (allow-none): return location for the X coordinate, or %NULL + * @y: (out) (allow-none): return location for the Y coordinate, or %NULL + * + * This function gets the fixed position of the actor, if set. If there + * is no fixed position set, this function returns %FALSE and doesn't set + * the x and y coordinates. + * + * Returns: %TRUE if the fixed position is set, %FALSE if it isn't + */ +gboolean +clutter_actor_get_fixed_position (ClutterActor *self, + float *x, + float *y) +{ + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE); + + if (self->priv->position_set) + { + const ClutterLayoutInfo *info; + + info = _clutter_actor_get_layout_info_or_defaults (self); + + if (x) + *x = info->fixed_pos.x; + + if (y) + *y = info->fixed_pos.y; + + return TRUE; + } + + return FALSE; +} + /** * clutter_actor_get_transformed_position: * @self: A #ClutterActor diff --git a/clutter/clutter/clutter-actor.h b/clutter/clutter/clutter-actor.h index e5fa72bae..a9829f02d 100644 --- a/clutter/clutter/clutter-actor.h +++ b/clutter/clutter/clutter-actor.h @@ -454,6 +454,10 @@ void clutter_actor_set_position gfloat x, gfloat y); CLUTTER_EXPORT +gboolean clutter_actor_get_fixed_position (ClutterActor *self, + float *x, + float *y); +CLUTTER_EXPORT void clutter_actor_get_position (ClutterActor *self, gfloat *x, gfloat *y);