Site Icon: Center initial crop position.

Starting out at the center of the image makes for a better user experience.

Props iseulde.
Fixes #33050.



git-svn-id: https://develop.svn.wordpress.org/trunk@33333 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Konstantin Obenland 2015-07-20 19:01:19 +00:00
parent b619b0c194
commit b480968d9b
1 changed files with 8 additions and 5 deletions

View File

@ -1934,7 +1934,7 @@
ratio = xInit / yInit,
xImg = realWidth,
yImg = realHeight,
imgSelectOptions;
x1, y1, imgSelectOptions;
controller.set( 'canSkipCrop', ! control.mustBeCropped( flexWidth, flexHeight, xInit, yInit, realWidth, realHeight ) );
@ -1946,6 +1946,9 @@
yInit = xInit / ratio;
}
x1 = ( xImg - xInit ) / 2;
y1 = ( yImg - yInit ) / 2;
imgSelectOptions = {
handles: true,
keys: true,
@ -1953,10 +1956,10 @@
persistent: true,
imageWidth: realWidth,
imageHeight: realHeight,
x1: 0,
y1: 0,
x2: xInit,
y2: yInit
x1: x1,
y1: y1,
x2: xInit + x1,
y2: yInit + y1
};
if ( flexHeight === false && flexWidth === false ) {