-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust Image Cropper handle (focal point) #1021
base: main
Are you sure you want to change the base?
Conversation
src/packages/core/components/input-image-cropper/image-cropper-focus-setter.element.ts
Outdated
Show resolved
Hide resolved
… feature/image-cropper-handle
…raco.CMS.Backoffice into feature/image-cropper-handle
There a minor issue when resetting focal point, where it also need to reset the coords like it does on image loaded here: It am not sure the disabled property is something we need, but I think it would be a nice feature. If think it may be useful to have a feature to show the focal point, but maybe some editors should allow the move it or in a special context like split view or when not active language variant. |
src/packages/core/components/input-image-cropper/image-cropper-focus-setter.element.ts
Outdated
Show resolved
Hide resolved
@iOvergaard @JesmoDev please have a look 😎 |
Hi @bjarnef looks good. I also see that you are trying to fix a few other things, like keyboard navigation etc. Thats cool, would it be possible to finish it in near future? Otherwise, I would recommend splitting your PRs up. Small PRs that are easy to review can sometimes be really good as they are fast to review and we can then get them merged in. In this way, we can keep the list of open PRs to a minimum. (as I was up for merging this, but its not done in its current state, just the change of the focus point look) :-) |
@nielslyngsoe it should be ready to review, but any feedback are welcome 😉 |
Do we have any way to know when reset focal point happens? It seems |
I found a workaround to update coords if focal point is updated/reset to center using the reset button. |
@bjarnef yes, that is one solution. But the one we mainly use is to append setter and getter methods to the property itself. You should be able to fairly simple find a lot of solutions doing so. A typical one is the |
@nielslyngsoe I tried the following instead. 03bcee2 A bit similar to the Line 19 in 11efe83
However to make Or call |
@JesmoDev this probably conflicts a bit with changes in #1052 This PR makes the Image Cropper handle works using keyboard navigation and use same logic as color picker handle. I could use some help with implementation of the property as @nielslyngsoe suggested - see last commit. |
@iOvergaard do you know how we can solve the last part? |
… feature/image-cropper-handle # Conflicts: # src/packages/media/media/components/input-image-cropper/image-cropper-focus-setter.element.ts
@iOvergaard feel free to make additional commits to this PR :) I noticed some other behavioural oddities.
Another minor issue I noticed is when opening developer console the image isn't re-calculated. Not a big issue, but I think it would similar a virtual keypad open on tablet. Anyway it worked nicer in old backoffice :) When not in crop mode (at Media "crop" menu item), we probably also need checkered background as before to see a white logo/image? |
@bjarnef All good proposals. Would you add them as separate issues, please?
This one we are aware of, we currently have no way of detecting if a media item is actually a folder - all media items can contain subitems, but obviously does not make sense to select one if it itself doesn't have an |
@iOvergaard can you have another look at latest changes. I think there are other enhancements, we can fix in other PRs. |
… feature/image-cropper-handle # Conflicts: # src/packages/media/media/components/input-image-cropper/image-cropper-preview.element.ts # src/packages/media/media/components/input-image-cropper/types.ts # src/packages/media/media/property-editors/media-picker/index.ts
@iOvergaard does the events need Does it mean when set it override these?
e.g.
|
Quality Gate passedIssues Measures |
@iOvergaard can you review this with the latest changes. It would be great to close this one. |
@iOvergaard did you see the latest comments/ commits? It would be great to finish this one 😊 |
Description
This PR adjust focal point (handle) in Image Cropper to be more consistent with handle in Color Area.
umbraco/Umbraco-CMS#16672
It moves the focal point based on
x
andy
coordinates in the container on mouse click or touch.Furthermore it moves in the handle / focal point on keyboard arrows, while holding down Shift key allows to fine-tune position.
Types of changes
Motivation and context
To re-use some existing logic and make the UI/UX consistent.
How to test?
Screenshots (if appropriate)
chrome_2tFi6FEudB.mp4
Checklist