Archived:JSR-226 - SVGLocatableElement.getBBox() returns wrong value when a transformation is applied for the inner elements (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Created: User:Technical writer 1 (14 Sep 2007)
Last edited: hamishwillee (30 Jul 2013)



When using the Scalable 2D Vector Graphics API, the method SVGLocatableElement.getBBox() returns a wrong value when a transformation is applied. The bounding box for an element is in that element's user space, which does not take the transformation of the element into account.


The correct value for the group’s bounding box is the one that does not take the transformation of inner elements into account.

How to reproduce

This issue affects JSR-226 when running on the emulator.

  <g id="group1" transform="translate(10, 20)" fill="red" > 
<rect id="rect1" transform="scale(2)" x="10" y="10" width="50" height="50"/>
<rect id="rect2" x="10" y="10" width="100" height="100"/>
<g id="group2" transform="translate(10, 20)" >
<rect id="rect3" x="0" y="10" width="150" height="50"/>
<circle id="circle1" cx="20" cy="20" r="100" />
  SVGLocatableElement group1Elem = (SVGLocatableElement)
SVGRect group1BBox = group1Elem.getBBox();
group1BBox = [-80, -80, 230, 200]
The correct value is: [-70, -60, 230, 200]


This issue is fixed in S60 3rd Edition, FP2 MIDP SDK.

This page was last modified on 30 July 2013, at 11:05.
32 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.