Safer way to add fixes to Clutter.Actor prototype (#327)

This commit is contained in:
Illya Klymov
2020-07-18 20:55:09 +02:00
committed by GitHub
parent c98fe8556e
commit a57dbdf1bb
+8 -2
View File
@@ -174,16 +174,22 @@ if (version[0] >= 3 && version[1] < 34) {
}
// Polyfill
if (!Clutter.Actor.prototype.raise_top) {
if (!Clutter.Actor.prototype.raise) {
Clutter.Actor.prototype.raise = function raise(above) {
const parent = this.get_parent();
if (!parent)
return;
parent.set_child_above_sibling(this, above);
}
Clutter.Actor.prototype.raise_top = function raise_top() {
}
if (!Clutter.Actor.prototype.raise_top) {
Clutter.Actor.prototype.raise_top = function raise_top() {
this.raise(null);
}
}
if (!Clutter.Actor.prototype.reparent) {
Clutter.Actor.prototype.reparent = function reparent(newParent) {
const parent = this.get_parent();
if (parent) {