deckdeckgo icon indicating copy to clipboard operation
deckdeckgo copied to clipboard

drr: Flexible positioning of the rotation anchor (top, left, right, bottom)

Open rfuehrer opened this issue 4 years ago • 4 comments

Affected part of DeckDeckGo

  • [X] Web Components

Feature Description

Is it possible that the position of the anchor can be changed? An option like rotation-ancohr:top|left|right|bottom (or rotation-ancohr-position) offers more flexibility in other usage scenarios.

Or is that already possible today through existing CSS properties?

Use Case

I use drr for a project where the user has to find out the alignment of different objects to each other. The anchor makes it obvious to the user how the element must be aligned in the superordinate context (anchor always upwards ;) ).

If the anchor positions of the displayed elements can be changed for each deckgo-drr object, the alignment of the elements in the overall context is no longer necessarily obvious.

rfuehrer avatar Jun 28 '21 14:06 rfuehrer

Thank you for the feature request.

What do you mean with "the position of the anchor can be changed"?

Do you mean like being able to select which anchor is active or not? Like saying "the top left corner can be used to rotate the element but no other corner" or something else?

peterpeterparker avatar Jun 28 '21 14:06 peterpeterparker

no, I mean the rotation anchor/handle, which is always shown in the middle of the upper line (marked in red).

image

Actually my intention is to change the orientation of an embedded image to the touch point for rotations.

This can be achieved by rotating the image or moving the rotation handle to the left, right or bottom border of this object.

The intention is not to reveal the natural orientation of the image through the handle :)

rfuehrer avatar Jun 28 '21 15:06 rfuehrer

Thank you for the explanation, all clear.

You would like to add new property (@Prop()) which should be use to display the "rotate" anchor either at the top, right (or end), bottom or left (or start).

The property should probably add a class to the shadowed dom and, the div.rotate should then be modified in the css accordingly.

That should do the trick.

Currently, we do not have such requirement and have also other shorten goals, therefore I won't personally implement it, at least within next weeks.

That being said, I am not against it. If you can provide a PR, happy to review it.

peterpeterparker avatar Jun 28 '21 16:06 peterpeterparker

Ii'll be happy to try my hand at it. I have a project right now in which i'm using the function for the first time - I hope it will be accepted by the client, then I can also invest more time here accordingly. The decisive factor is the feedback from the client.

As soon as it becomes more concrete, i will gladly show the usecase live.

rfuehrer avatar Jun 30 '21 08:06 rfuehrer