mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user