Specify canvas size by using CSS width/height.
commit559523a154c6495fc263973a43ac0ca3742e3162
authorhirono@chromium.org <hirono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 22 Jul 2014 09:15:18 +0000 (22 09:15 +0000)
committerhirono@chromium.org <hirono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 22 Jul 2014 09:15:18 +0000 (22 09:15 +0000)
tree273722c99442651fb9a7fc5d8b016568c0d6ecd7
parentf9bdf777a13404ba25e0e8cdf99a3554320529c9
Specify canvas size by using CSS width/height.

In Gallery, the size of the slide image's canvas is scaled by
window.devicePixelRatio. For example, if the devicePixelRatio is 2, the doubled
size canvas is prepared and it is scaled to displaying size so that the pixels
of canvas fit to the device pixels.

Previously the canvas is scaled by using CSS transformation. Thus the element
position is calculated by the original canvas size, and then it is scaled. This
makes the position calculation of canvas complex, and it was regressed at the
crrev.com/398263002.

At this CL, canvas is scaled by using CSS width/height property instead of
bringing back the complex position calculation.

BUG=395062
TEST=manually

Review URL: https://codereview.chromium.org/402863002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284654 0039d316-1c4b-4281-b951-d872f2087c98
ui/file_manager/gallery/js/image_editor/image_view.js
ui/file_manager/gallery/js/image_editor/viewport.js