align-constraint: Offset the position after the alignment factor

Instead of aligning (pos + size), align on size alone, and then offset
by pos.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2168
This commit is contained in:
Emmanuele Bassi 2010-07-02 11:38:22 +01:00
parent 884df17536
commit 9338df438c

View File

@ -104,14 +104,14 @@ update_actor_position (ClutterAlignConstraint *align)
switch (align->align_axis)
{
case CLUTTER_ALIGN_X_AXIS:
new_position = ((source_width - actor_width) + source_x)
* align->factor;
new_position = ((source_width - actor_width) * align->factor)
+ source_x;
clutter_actor_set_x (actor, new_position);
break;
case CLUTTER_ALIGN_Y_AXIS:
new_position = ((source_height - actor_height) + source_y)
* align->factor;
new_position = ((source_height - actor_height) * align->factor)
+ source_y;
clutter_actor_set_y (actor, new_position);
break;
}