Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6010725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:09:28+00:00 2026-05-23T02:09:28+00:00

I have a g element that contains one or more path elements. As I

  • 0

I have a g element that contains one or more path elements. As I mentioned in another question, I scale and translate the g element by computing a transform attribute so that it fits on a grid in another part of the canvas.

The calculation is done using the difference between two rectangles, the getBBox() from the g element and the rectangle around the grid.

Here is the question — after I do the transform, I update the contents of the g element and call getBBox() again, without removing the transform. The resulting rectangle appears to be calculated without considering the transform. I would have expected it to reflect the change. Is this behavior consistent with the SVG specification? How do I get the bounding box of the transformed rectangle?

This, BTW, is in an HTML 5 document running in Firefox 4, if that makes any difference.

Update: Apparently this behavior seems pretty clearly in violation of the specification. From the text here at w3c:

SVGRect getBBox()

Returns the tight bounding box in current user space (i.e., after application of the ‘transform’ attribute, if any) on the geometry of all contained graphics elements, exclusive of stroking, clipping, masking and filter effects). Note that getBBox must return the actual bounding box at the time the method was called, even in case the element has not yet been rendered.

Am I reading this correctly? If so this seems to be an errata in the SVG implementation Firefox uses; I haven’t had a chance to try any other. I would file a bug report if someone could point me to where.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:09:29+00:00Added an answer on May 23, 2026 at 2:09 am

    The behaviour you see is correct, and consistent with the spec.
    The transform gets applied, then the bbox is calculated in “current user units”, i.e. the current user space. So if you want to see the result of a transform on the element you’d need to look at the bbox of a parent node or similar.
    It’s a bit confusing, but explained a lot better in the SVG Tiny 1.2 spec for SVGLocatable
    That contains a number of examples that clarify what it’s supposed to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form element that contains multiple lines of inputs. Think of each
I have a div element that has an id and this div contains a
I have an xml file that contains its element like <ab:test>Str</ab:test> When I am
I have a rather large list of data that contains 5 properties per element.
I have a numeric vector, it contains patches of elements that are repeating, something
I have some HTML code that contains nested <ul> elements and I need to
I have a text file that contains more or less paragraphs. The text is
I have a xml that has so many elements and most of that contain
I often have to deal with XML documents that contain namespaced elements, but doesn't
I have an element that is similar to a tag (because it has word-wrap:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.