Namespaces
Variants
Actions

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

Jump to: navigation, search
Archived.png
Archived: 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}}.

SignpostIcon Palette 52.png
Article Metadata

Compatibility
Platform(s): S60 3rd Edition, FP1 MIDP SDK

Article
Created: User:Technical writer 1 (14 Sep 2007)
Last edited: hamishwillee (28 Jun 2012)

Contents

Overview

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.

Description

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" />
</g>
</g>
  SVGLocatableElement group1Elem = (SVGLocatableElement)
svgImage.getDocument().getElementById(group1);
 
SVGRect group1BBox = group1Elem.getBBox();
 
group1BBox = [-80, -80, 230, 200]
The correct value is: [-70, -60, 230, 200]

Solution

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

This page was last modified on 28 June 2012, at 08:39.
426 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved