Make it possible to hide focal point without disable it #19889
Replies: 1 comment
-
@nielslyngsoe not sure if E.g. in some use-cases from real world projects it is okay the focal point / hotspot initially is empty, but should allow to set it on demand - or clear it later. I also consider it if makes sense to support an array of focal point objects, perhaps not inside ImageCropper, but making it possible to re-use the component in other context (not necessary related to ImageSharp center coordinate). I found this example, which demonstrate it. Of course we can create a custom component for this, but mainly I mean the editable part with draggable focal point(s), which already exist for a single focal point. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
While working on the Umbraco Community Hotspots package I noticed there is no easy way to hide focal point although value is set to
null
the focal point is still shown.It can be disabled, which Media Picker use, but in that case the focal point isn't shown clicking anywhere in the image.
I solved it by hiding the focal point via CSS matching, when value is
null
, which also make it possible to clear an existing focal point set in image. Sometimes setting a focal point shouldn't be required in this component although it probably make sense inside ImageCropper.In v13 it was called
disableFocalPoint
:https://github.com/umbraco/Umbraco-CMS/blob/v13/main/src/Umbraco.Web.UI.Client/src/common/directives/components/imaging/umbimagegravity.directive.js#L221
Renamed to
hideFocalPoint
in new backoffice, but I don't think the functionality has changed:Umbraco-CMS/src/Umbraco.Web.UI.Client/src/packages/media/media/components/input-image-cropper/image-cropper-focus-setter.element.ts
Lines 50 to 51 in 2289493
Beta Was this translation helpful? Give feedback.
All reactions