js: Replace Clutter.Actor.get_allocation_geometry()

The function was deprecated and has now been dropped from mutter.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/776
This commit is contained in:
Florian Müllner 2019-10-21 17:42:12 +02:00
parent 6965781d59
commit 43cf466d09
2 changed files with 14 additions and 14 deletions

View File

@ -477,16 +477,16 @@ class RedBorderEffect extends Clutter.Effect {
color.init_from_4ub(0xff, 0, 0, 0xc4); color.init_from_4ub(0xff, 0, 0, 0xc4);
Cogl.set_source_color(color); Cogl.set_source_color(color);
let geom = actor.get_allocation_geometry(); let alloc = actor.get_allocation_box();
let width = 2; let width = 2;
// clockwise order // clockwise order
Cogl.rectangle(0, 0, geom.width, width); Cogl.rectangle(0, 0, alloc.get_width(), width);
Cogl.rectangle(geom.width - width, width, Cogl.rectangle(alloc.get_width() - width, width,
geom.width, geom.height); alloc.get_width(), alloc.get_height());
Cogl.rectangle(0, geom.height, Cogl.rectangle(0, alloc.get_height(),
geom.width - width, geom.height - width); alloc.get_width() - width, alloc.get_height() - width);
Cogl.rectangle(0, geom.height - width, Cogl.rectangle(0, alloc.get_height() - width,
width, width); width, width);
} }
}); });

View File

@ -36,16 +36,16 @@ function test() {
obin.connect_after('paint', actor => { obin.connect_after('paint', actor => {
Cogl.set_source_color4f(0, 1, 0, 1); Cogl.set_source_color4f(0, 1, 0, 1);
let geom = actor.get_allocation_geometry(); let alloc = actor.get_allocation_box();
let width = 3; let width = 3;
// clockwise order // clockwise order
Cogl.rectangle(0, 0, geom.width, width); Cogl.rectangle(0, 0, alloc.get_width(), width);
Cogl.rectangle(geom.width - width, width, Cogl.rectangle(alloc.get_width() - width, width,
geom.width, geom.height); alloc.get_width(), alloc.get_height());
Cogl.rectangle(0, geom.height, Cogl.rectangle(0, alloc.get_height(),
geom.width - width, geom.height - width); alloc.get_width() - width, alloc.get_height() - width);
Cogl.rectangle(0, geom.height - width, Cogl.rectangle(0, alloc.get_height() - width,
width, width); width, width);
}); });
tbox.add(obin); tbox.add(obin);