Skip to content

clutter/align-constraint: Add new property and stop offsetting by source position

This MR does two things:

  • it adds a new property to ClutterAlignConstraint which is very useful for gnome-shell's overview (see gnome-shell!1298 (merged))

  • it stops offsetting the position of the constraint actor by the position of the source, which currently limits the usefulness of ClutterAlignConstraints quite a bit, this is needed by gnome-shell!303.

Example of the pivot-point property:

Screenshot_from_2019-08-21_13-38-38

let red = Clutter.Color.new(155, 0, 0, 255)
let green = Clutter.Color.new(0, 255, 0, 160)

let actor = new St.Widget({ width: 310, height: 200, background_color: red });
let actor2 = new Clutter.Actor({ width: 100, height: 100, background_color: green });

let constraint = new Clutter.AlignConstraint({
    source: actor,
    align_axis: Clutter.AlignAxis.BOTH,
    pivot_point: new Graphene.Point({ x: 0.5, y: 1 }),
    factor: 1
});

actor2.add_constraint(constraint);

global.stage.add_child(actor);
global.stage.add_child(actor2);
Edited by Jonas Dreßler

Merge request reports