flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [2/5] git commit: [flex-asjs] [refs/heads/develop] - when % width, you get fractional numbers yet offsetWidth rounds down, so check the computed width which will include the fractional part, otherwise you'll get a half-pixel gap
Date Tue, 08 Sep 2015 06:39:29 GMT
when % width, you get fractional numbers yet offsetWidth rounds down, so check the computed
width which will include the fractional part, otherwise you'll get a half-pixel gap


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/606b28bf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/606b28bf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/606b28bf

Branch: refs/heads/develop
Commit: 606b28bfe9f6c9275069db97b4868b26f2ef75ac
Parents: 3ca1f7d
Author: Alex Harui <aharui@apache.org>
Authored: Sat Sep 5 22:13:18 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Sat Sep 5 22:13:18 2015 -0700

----------------------------------------------------------------------
 .../HTML/js/src/org/apache/flex/html/beads/PanelView.js     | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/606b28bf/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js
index f4132ef..3965772 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js
@@ -110,18 +110,21 @@ org.apache.flex.html.beads.PanelView.
     prototype.layoutViewBeforeContentLayout = function() {
   var vm = this.viewportModel;
   var host = this._strand;
-
+  var w = host.width;
+  var s = window.getComputedStyle(host.element);
+  var sw = Number(s.width.substring(0, s.width.length - 2));
+  if (sw > w) w = sw;
   vm.borderMetrics = org.apache.flex.utils.CSSContainerUtils.getBorderMetrics(host);
   this.titleBar.x = 0;
   this.titleBar.y = 0;
   if (!host.isWidthSizedToContent())
-    this.titleBar.width = host.width - vm.borderMetrics.left - vm.borderMetrics.right;
+    this.titleBar.width = w - vm.borderMetrics.left - vm.borderMetrics.right;
   vm.chromeMetrics = this.getChromeMetrics();
   this.viewport.setPosition(vm.chromeMetrics.left,
                             vm.chromeMetrics.top);
   this.viewport.layoutViewportBeforeContentLayout(
       !host.isWidthSizedToContent() ?
-          host.width - vm.borderMetrics.left - vm.borderMetrics.right -
+          w - vm.borderMetrics.left - vm.borderMetrics.right -
                        vm.chromeMetrics.left - vm.chromeMetrics.right : NaN,
       !host.isHeightSizedToContent() ?
           host.height - vm.borderMetrics.top - vm.borderMetrics.bottom -


Mime
View raw message