WordPress.org

Make WordPress Core

Changeset 33333


Ignore:
Timestamp:
07/20/2015 07:01:19 PM (5 years ago)
Author:
obenland
Message:

Site Icon: Center initial crop position.

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

Props iseulde.
Fixes #33050.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r33329 r33333  
    19351935                xImg  = realWidth,
    19361936                yImg  = realHeight,
    1937                 imgSelectOptions;
     1937                x1, y1, imgSelectOptions;
    19381938
    19391939            controller.set( 'canSkipCrop', ! control.mustBeCropped( flexWidth, flexHeight, xInit, yInit, realWidth, realHeight ) );
     
    19461946                yInit = xInit / ratio;
    19471947            }
     1948
     1949            x1 = ( xImg - xInit ) / 2;
     1950            y1 = ( yImg - yInit ) / 2;
    19481951
    19491952            imgSelectOptions = {
     
    19541957                imageWidth: realWidth,
    19551958                imageHeight: realHeight,
    1956                 x1: 0,
    1957                 y1: 0,
    1958                 x2: xInit,
    1959                 y2: yInit
     1959                x1: x1,
     1960                y1: y1,
     1961                x2: xInit + x1,
     1962                y2: yInit + y1
    19601963            };
    19611964
Note: See TracChangeset for help on using the changeset viewer.