~unity-team/clutk/update-menu-positioning

« back to all changes in this revision

Viewing changes to clutk/ctk-menu.c

  • Committer: Neil Jagdish Patel
  • Date: 2010-07-04 08:27:52 UTC
  • Revision ID: neil.patel@canonical.com-20100704082752-98weun8h13yvo1zd
- Use get_abs_tranformed_vertices to figure out the exact positon of an actor on the stage to calculate where the menu should be

modified:
  clutk/ctk-menu.c

Show diffs side-by-side

added added

removed removed

Lines of Context:
1123
1123
  g_return_if_fail (CTK_IS_MENU (menu));
1124
1124
  g_return_if_fail (CTK_IS_ACTOR (actor));
1125
1125
 
1126
 
  ClutterActorBox box;
1127
1126
  gfloat x, y, w, h;
1128
 
 
1129
 
  ctk_actor_get_stored_allocation (actor, &box);
1130
 
  w = clutter_actor_box_get_width (&box);
1131
 
  h = clutter_actor_box_get_height (&box);
1132
 
  clutter_actor_get_position (CLUTTER_ACTOR (actor), &x, &y);
 
1127
  ClutterVertex verts[4];
 
1128
 
 
1129
  clutter_actor_get_abs_allocation_vertices (CLUTTER_ACTOR (actor), verts);
 
1130
 
 
1131
  x = verts[0].x;
 
1132
  y = verts[0].y;
 
1133
  w = verts[3].x - x;
 
1134
  h = verts[3].y - y;
1133
1135
 
1134
1136
  clutter_actor_set_position (CLUTTER_ACTOR (menu),
1135
 
                              x + w, y + (h/2.0f));
 
1137
                              x + w, y);
1136
1138
}
1137
1139
 
1138
1140
static void