Commit 33ba2974 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

effects: Properly copy previous geometry

In QJSEngine, QRect is an Object, which is correct. This means that we
cannot use simple assignment operator to copy geometries, we need to use
standard ways to copy Objects, such as Object.assign() or the spread
operator, which is not available in QJSEngine yet.
parent bd4d17b3
......@@ -21,7 +21,7 @@ var fullScreenEffect = {
var oldGeometry, newGeometry;
oldGeometry = window.oldGeometry;
newGeometry = window.geometry;
window.oldGeometry = newGeometry;
window.oldGeometry = Object.assign({}, newGeometry);
window.fullScreenAnimation1 = animate({
window: window,
duration: fullScreenEffect.duration,
......@@ -77,7 +77,7 @@ var fullScreenEffect = {
}
}
}
window.oldGeometry = window.geometry;
window.oldGeometry = Object.assign({}, window.geometry);
},
init: function () {
effect.configChanged.connect(fullScreenEffect.loadConfig);
......
......@@ -23,8 +23,8 @@ var maximizeEffect = {
newGeometry = window.geometry;
if (oldGeometry.width == newGeometry.width && oldGeometry.height == newGeometry.height)
oldGeometry = window.olderGeometry;
window.olderGeometry = window.oldGeometry;
window.oldGeometry = newGeometry;
window.olderGeometry = Object.assign({}, window.oldGeometry);
window.oldGeometry = Object.assign({}, newGeometry);
window.maximizeAnimation1 = animate({
window: window,
duration: maximizeEffect.duration,
......@@ -80,8 +80,8 @@ var maximizeEffect = {
}
}
}
window.oldGeometry = window.geometry;
window.olderGeometry = oldGeometry;
window.oldGeometry = Object.assign({}, window.geometry);
window.olderGeometry = Object.assign({}, oldGeometry);
},
init: function () {
effect.configChanged.connect(maximizeEffect.loadConfig);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment