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:
parent
884df17536
commit
9338df438c
@ -104,14 +104,14 @@ update_actor_position (ClutterAlignConstraint *align)
|
|||||||
switch (align->align_axis)
|
switch (align->align_axis)
|
||||||
{
|
{
|
||||||
case CLUTTER_ALIGN_X_AXIS:
|
case CLUTTER_ALIGN_X_AXIS:
|
||||||
new_position = ((source_width - actor_width) + source_x)
|
new_position = ((source_width - actor_width) * align->factor)
|
||||||
* align->factor;
|
+ source_x;
|
||||||
clutter_actor_set_x (actor, new_position);
|
clutter_actor_set_x (actor, new_position);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_ALIGN_Y_AXIS:
|
case CLUTTER_ALIGN_Y_AXIS:
|
||||||
new_position = ((source_height - actor_height) + source_y)
|
new_position = ((source_height - actor_height) * align->factor)
|
||||||
* align->factor;
|
+ source_y;
|
||||||
clutter_actor_set_y (actor, new_position);
|
clutter_actor_set_y (actor, new_position);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user