Namespaces
Variants
Actions

Archived:JSR-226 - SVGLocatableElement.getScreenBBox() and SVGLocatableElement.getScreenCTM() may return wrong values for group 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 (29 Jun 2012)

Contents

Overview

When using the Scalable 2D Vector Graphics API, the methods SVGLocatableElement.getScreenBBox() and SVGLocatableElement.getScreenCTM() may return wrong values in certain cases.

Description

The box coordinates are in the screen coordinate space, which is connected to the current user coordinate space by the matrix returned by SVGLocatableElement.getScreenCTM(). This happens when the group includes another <group> element which contains transformations.

How to reproduce

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

  <svg viewBox="-100 -100 240 320">
<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>
</svg>
 
svgImage.setViewportWidth( 240 );
svgImage.setViewportHeight( 320 );
 
SVGLocatableElement group1Elem = (SVGLocatableElement)
svgImage.getDocument().getElementById( group1 );
 
SVGRect screenBBox = group1Elem.getScreenBBox();
SVGMatrix m = group1Elem.getScreenCTM();

The returned values are:

 screenBBox  = [-60, -40, 230, 200]
 m = [1, 0, 0; 1, 10, 20];

The correct values are:

 screenBBox  = [40, 60, 230, 200]
 m =  [1, 0, 0; 1, 110, 120]

Solution

No solution available.

This page was last modified on 29 June 2012, at 08:46.
352 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