Swap focal point order to left,top to match resize X,Y coordinates

This commit is contained in:
Ronald Barendse
2021-08-10 17:17:40 +02:00
parent 0753353cf7
commit 766530fcd3
3 changed files with 8 additions and 8 deletions

View File

@@ -70,11 +70,11 @@ angular.module("umbraco")
if ($scope.control.value.coordinates) {
// New way, crop by percent must come before width/height.
var coords = $scope.control.value.coordinates;
url += `?crop=${coords.x1},${coords.y1},${coords.x2},${coords.y2}&cropmode=percentage`;
url += `?cc=${coords.x1},${coords.y1},${coords.x2},${coords.y2}`;
} else {
// Here in order not to break existing content where focalPoint were used.
if ($scope.control.value.focalPoint) {
url += `?rxy=${$scope.control.value.focalPoint.top},${$scope.control.value.focalPoint.left}`;
url += `?rxy=${$scope.control.value.focalPoint.left},${$scope.control.value.focalPoint.top}`;
} else {
// Prevent black padding and no crop when focal point not set / changed from default
url += '?rxy=0.5,0.5';