From 6d1b1de04c75d11e45154c0555a87ebce4a4b45d Mon Sep 17 00:00:00 2001 From: Dmitri Pisarev Date: Mon, 9 Apr 2018 11:04:39 +0300 Subject: [PATCH] BUGFIX: respect default option in cropping --- .../src/SecondaryEditors/ImageCropper/model.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/model.js b/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/model.js index b9ef6e9ed5..d1640c30c1 100644 --- a/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/model.js +++ b/packages/neos-ui-editors/src/SecondaryEditors/ImageCropper/model.js @@ -142,7 +142,7 @@ const DEFAULT_BOUNDARIES = { }; const determineInitialAspectRatioStrategy = (image, neosConfiguration) => { - const {options} = neosConfiguration; + const {options, defaultOption} = neosConfiguration; const aspectRatioLocked = neosConfiguration.locked.height > 0 && neosConfiguration.locked.width > 0; if (aspectRatioLocked) { return new LockedAspectRatioStrategy(neosConfiguration.locked.width, neosConfiguration.locked.height); @@ -174,6 +174,10 @@ const determineInitialAspectRatioStrategy = (image, neosConfiguration) => { .map(o => new ConfiguredAspectRatioStrategy(o.width, o.height, o.label)) ) + .orElse( + when(defaultOption)(new ConfiguredAspectRatioStrategy(options[defaultOption].width, options[defaultOption].height, options[defaultOption].label)) + ) + // // As last resort, assume that no aspect ratio was applied so far //