We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How do you make an Annotation origin be in the center of the Annotation?

Home Forums General Questions How do you make an Annotation origin be in the center of the Annotation?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #57237
    vern
    Customer

    Hello,
    I would like to have the origin of normal Verge3d annotations to be in the center of the annotation element instead of the top left like it usually is. How would I achieve that since the CSS transform and transform-origin properties don’t seem to work on annotation objects?

    I attached a picture of the way I have annotations now. Just would like the annotation center to also be at the object center instead of the way it is now.

    Attachments:
    You must be logged in to view attached files.
    #57239
    kdv
    Participant

    add negative margin-left for the CSS rule .v3d-annotation or you can set this value for an element by its id.

    #57242
    vern
    Customer

    Since every annotation is a different size I would just use its ID, get the width and make the margin-left that width / 2. That should work right?

    #57248
    kdv
    Participant

    Not exactly. By default the origin is here, in the center of the circle.

    The diameter is 32px, so the left margin will be -(width-32)/2px

    #57250
    vern
    Customer

    Yes, exactly. I didn’t mention subtracting the width just wanted to make sure I had the idea correct with accessing the individual annotation property.

    Thank you!! I’ll try it out today.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.