bind-constraint: Add BIND_POSITION and BIND_SIZE

CLUTTER_BIND_POSITION and CLUTTER_BIND_SIZE are two convenience
enumeration values for binding x and y, and width and height
respectively, using a single ClutterBindConstraint.
This commit is contained in:
Emmanuele Bassi
2011-01-25 11:10:29 +00:00
parent 4f53653bf9
commit 5329c98694
4 changed files with 23 additions and 6 deletions

View File

@ -175,6 +175,13 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
allocation->y2 = allocation->y1 + actor_height;
break;
case CLUTTER_BIND_POSITION:
allocation->x1 = source_position.x + bind->offset;
allocation->y1 = source_position.y + bind->offset;
allocation->x2 = allocation->x1 + actor_width;
allocation->y2 = allocation->y1 + actor_height;
break;
case CLUTTER_BIND_WIDTH:
allocation->x2 = allocation->x1 + source_width + bind->offset;
break;
@ -183,6 +190,11 @@ clutter_bind_constraint_update_allocation (ClutterConstraint *constraint,
allocation->y2 = allocation->y1 + source_height + bind->offset;
break;
case CLUTTER_BIND_SIZE:
allocation->x2 = allocation->x1 + source_width + bind->offset;
allocation->y2 = allocation->y1 + source_height + bind->offset;
break;
default:
g_assert_not_reached ();
break;