[gnome-shell] Bug 594184 - Fix up glow positioning logic
- From: Owen Taylor <otaylor src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-shell] Bug 594184 - Fix up glow positioning logic
- Date: Sat, 5 Sep 2009 00:08:53 +0000 (UTC)
commit fa5fb6b8a8a1fefb68728e983c9d98b89ebcc1f5
Author: Colin Walters <walters verbum org>
Date: Fri Sep 4 19:58:37 2009 -0400
Bug 594184 - Fix up glow positioning logic
We were allowing the glow allocation to go too far to the right;
clean up the logic.
js/ui/appIcon.js | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/appIcon.js b/js/ui/appIcon.js
index 5e68839..46bce10 100644
--- a/js/ui/appIcon.js
+++ b/js/ui/appIcon.js
@@ -89,10 +89,10 @@ AppIcon.prototype = {
let targetWidth = availWidth;
let xPadding = 0;
if (naturalWidth < availWidth) {
- xPadding = (availWidth - naturalWidth) / 2;
+ xPadding = Math.floor((availWidth - naturalWidth) / 2);
}
- childBox.x1 = Math.floor(xPadding);
- childBox.x2 = availWidth;
+ childBox.x1 = xPadding;
+ childBox.x2 = availWidth - xPadding;
childBox.y1 = GLOW_PADDING_VERTICAL;
childBox.y2 = availHeight - GLOW_PADDING_VERTICAL;
this._name.allocate(childBox, flags);
@@ -101,7 +101,8 @@ AppIcon.prototype = {
if (this._glowBox != null) {
let glowPaddingHoriz = Math.max(0, xPadding - GLOW_PADDING_HORIZONTAL);
- childBox.x1 = Math.floor(glowPaddingHoriz);
+ glowPaddingHoriz = Math.max(GLOW_PADDING_HORIZONTAL, glowPaddingHoriz);
+ childBox.x1 = glowPaddingHoriz;
childBox.x2 = availWidth - glowPaddingHoriz;
childBox.y1 = 0;
childBox.y2 = availHeight;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]