[gnome-shell] workspace: Separate out per-window scaling as a separate variable
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] workspace: Separate out per-window scaling as a separate variable
- Date: Thu, 28 Feb 2013 23:15:47 +0000 (UTC)
commit 1a33de91e222c2502d0702b9e255f0fd32ac0f8c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Feb 28 15:00:59 2013 -0500
workspace: Separate out per-window scaling as a separate variable
Multiplication is linear, so we can split this out as a separate
component. This will make it easier to think of it as an additional
per-window scaling factor, rather than tweaking the scale a bit,
which is more correct to the model.
https://bugzilla.gnome.org/show_bug.cgi?id=694902
js/ui/workspace.js | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 14a1057..059d003 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -589,9 +589,9 @@ const LayoutStrategy = new Lang.Class({
windows: [] };
},
- // Computes and returns a fancy scale for @window using the
- // base scale, @scale.
- _computeWindowScale: function(window, scale) {
+ // Computes and returns an individual scaling factor for @window,
+ // to be applied in addition to the overal layout scale.
+ _computeWindowScale: function(window) {
// Since we align windows next to each other, the height of the
// thumbnails is much more important to preserve than the width of
// them, so two windows with equal height, but maybe differering
@@ -604,8 +604,7 @@ const LayoutStrategy = new Lang.Class({
// good. We'll use a multiplier of 1.5 for this.
// Map from [0, 1] to [1.5, 1]
- let fancyScale = _interpolate(1.5, 1, ratio) * scale;
- return fancyScale;
+ return _interpolate(1.5, 1, ratio);
},
// Compute the size of each row, by assigning to the properties
@@ -697,7 +696,7 @@ const LayoutStrategy = new Lang.Class({
for (let j = 0; j < row.windows.length; j++) {
let window = row.windows[j];
- let s = this._computeWindowScale(window, scale);
+ let s = scale * this._computeWindowScale(window);
s = Math.min(s, WINDOW_CLONE_MAXIMUM_SCALE);
let width = window.actor.width * s;
let height = window.actor.height * s;
@@ -755,7 +754,7 @@ const UnalignedLayoutStrategy = new Lang.Class({
for (; windowIdx < windows.length; windowIdx++) {
let window = windows[windowIdx];
- let s = this._computeWindowScale(window, 1);
+ let s = this._computeWindowScale(window);
let width = window.actor.width * s;
let height = window.actor.height * s;
row.fullHeight = Math.max(row.fullHeight, height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]