Reviewers: mp+133989_code.launchpad.net,

Message:
Please take a look.

Description:
Fix 1px too wide svg issue

Due to sizes being set with percentages, widths are computed as
decimals, but are reported as integers in DOM attributes (Computed
width: 1331.949951171875, reported width: 1332) resulting in rounding
errors.  YUI's getComputedStyle() returns the decimal width, allowing us
to round.

https://code.launchpad.net/~makyo/juju-gui/svg-width-bug-1076413/+merge/133989

(do not edit description out of merge proposal)


Please review this at https://codereview.appspot.com/6814125/

Affected files:
   A [revision details]
   M app/views/utils.js


Index: [revision details]
=== added file '[revision details]'
--- [revision details]  2012-01-01 00:00:00 +0000
+++ [revision details]  2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: [email protected]
+New revision: [email protected]

Index: app/views/utils.js
=== modified file 'app/views/utils.js'
--- app/views/utils.js  2012-11-01 13:21:53 +0000
+++ app/views/utils.js  2012-11-12 20:36:10 +0000
@@ -811,7 +811,8 @@
            (bottomNavbar ? bottomNavbar.get('offsetHeight') : 0) -
            navbar.get('offsetHeight') - 1;

-      result.width = viewport.get('offsetWidth');
+      result.width = Math.floor(parseFloat(
+          viewport.getComputedStyle('width')));

        // Make sure we don't get sized any smaller than the minimum.
        result.height = Math.max(result.height, minheight || 0);





-- 
https://code.launchpad.net/~makyo/juju-gui/svg-width-bug-1076413/+merge/133989
Your team Juju GUI Hackers is requested to review the proposed merge of 
lp:~makyo/juju-gui/svg-width-bug-1076413 into lp:juju-gui.

-- 
Mailing list: https://launchpad.net/~yellow
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yellow
More help   : https://help.launchpad.net/ListHelp

Reply via email to