Skip to content

Commit

Permalink
GPU-1115: Disable binary image transformation to fit to the new image…
Browse files Browse the repository at this point in the history
… manipulation modes
  • Loading branch information
plyhun committed Sep 27, 2023
1 parent bab83df commit 7914250
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.gentics.mesh</groupId>
<artifactId>mesh-admin-ui2</artifactId>
<version>1.3.6</version>
<version>1.3.7</version>

<packaging>pom</packaging>
<name>Mesh - Admin UI</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,21 +369,21 @@ describe('BinaryFieldComponent:', () => {
focalPointX: 0.5,
focalPointY: 0.5
});

expect(instance.binaryFieldComponent.scaledTransform).toEqual({
width: 208,
height: 146,
cropRect: {
width: 208,
height: 208,
startX: 21,
startY: 21
},
scaleX: 0.85,
scaleY: 0.5,
focalPointX: 0.5,
focalPointY: 0.5
});
//
// expect(instance.binaryFieldComponent.scaledTransform).toEqual({
// width: 208,
// height: 146,
// cropRect: {
// width: 208,
// height: 208,
// startX: 21,
// startY: 21
// },
// scaleX: 0.85,
// scaleY: 0.5,
// focalPointX: 0.5,
// focalPointY: 0.5
// });
}
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ export class BinaryFieldComponent extends BaseFieldComponent {
onImageLoad(): void {
this.loadingPreview = false;
if (this.binaryProperties && this.binaryProperties.file && this.lastParams) {
this.scaledTransform = {
...this.lastParams,
...{
focalPointX: this.lastParams.focalPointX,
focalPointY: this.lastParams.focalPointY
}
};
// this.scaledTransform = {
// ...this.lastParams,
// ...{
// focalPointX: this.lastParams.focalPointX,
// focalPointY: this.lastParams.focalPointY
// }
// };
this.lastParams = undefined;
}
}
Expand All @@ -123,16 +123,16 @@ export class BinaryFieldComponent extends BaseFieldComponent {

this.modalService
.fromComponent(ImageEditorModalComponent, undefined, {
imageUrl,
params: {
...this.transformParams,
// set focalpoint data if exist
...(imageField.focalPoint &&
({
focalPointX: imageField.focalPoint.x,
focalPointY: imageField.focalPoint.y
} as any))
}
imageUrl
// , params: {
// ...this.transformParams,
// // set focalpoint data if exist
// ...(imageField.focalPoint &&
// ({
// focalPointX: imageField.focalPoint.x,
// focalPointY: imageField.focalPoint.y
// } as any))
// }
})
.then(modal => modal.open())
.then(params => {
Expand All @@ -145,18 +145,18 @@ export class BinaryFieldComponent extends BaseFieldComponent {
this.lastParams = params;
} else {
const value = this.api.getValue();
this.scaledTransform = this.calculateScaledTransformParams(imageField, params);
//this.scaledTransform = this.calculateScaledTransformParams(imageField, params);
this.api.setValue({
...value,
// update focalpoint data
focalPoint: {
x: params.focalPointX,
y: params.focalPointY
},
transform: params
...value
// // update focalpoint data
// , focalPoint: {
// x: params.focalPointX,
// y: params.focalPointY
// },
// transform: params
});
}
this.transformParams = params;
// this.transformParams = params;
this.changeDetector.markForCheck();
});
}
Expand Down

0 comments on commit 7914250

Please sign in to comment.