Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16099 closed defect (fixed)

Android 4 issue: setTransform on a text node is broken

Reported by: Damien Mandrioli Owned by: Patrick Ruzand
Priority: undecided Milestone: 1.9
Component: DojoX GFX Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description

Tested on HTC One X and Galaxy S3 both running 4.0.4. The following sample demonstrates the problem. The line is centered on all plaforms (including Android 2.x) but left-aligned on Android 4. See screenshots.


<!DOCTYPE html>
<html>
	<head>
		<title>Text Transform</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type="text/javascript" src="../../../dojo/dojo.js" 
				data-dojo-config="async:true, isDebug:true">
		</script>
		<script type="text/javascript">
			require(["dojo/ready", "dojo/dom", "dojox/gfx"], function(ready, dom, gfx){
				ready(function(){
					var container = dom.byId("gfx_holder");
					surface = gfx.createSurface(container, 600, 600);
					surface.createLine({x1: 300, y1:0, x2:300, y2:600}).setStroke("red");
					surface.createText({
						x: 0,
						y: 0,
						text: "-----><-----",
						align: "middle"
					}).setFill("black").setTransform({dx:300, dy:300});
					
				});
			});
		</script>
	</head>
	<body>
		<div id="gfx_holder" style="width: 600px; height: 600px; border: solid;">
		</div>
	</body>
</html>

Attachments (2)

text_align_all.png (2.5 KB) - added by Damien Mandrioli 7 years ago.
text_align_android4.png (26.8 KB) - added by Damien Mandrioli 7 years ago.

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by Damien Mandrioli

Attachment: text_align_all.png added

Changed 7 years ago by Damien Mandrioli

Attachment: text_align_android4.png added

comment:1 Changed 7 years ago by cjolif

Owner: changed from Eugene Lazutkin to Patrick Ruzand
Status: newassigned

comment:2 Changed 7 years ago by Patrick Ruzand

It's a bug in the android default browser. I have filled a BR here: https://code.google.com/p/android/issues/detail?id=38202

The problem is due to the text-rendering="optimizeLegibility" property that is set by gfx. Removing this hint gives the correct result. A patch specific to Android 4 should therefore be possible.

Last edited 7 years ago by Patrick Ruzand (previous) (diff)

comment:3 Changed 7 years ago by Patrick Ruzand

Resolution: fixed
Status: assignedclosed

In [29794]:

fix align:middle issue on android 4. fixes #16099, !strict

comment:4 Changed 7 years ago by cjolif

Milestone: tbd1.9

comment:5 Changed 7 years ago by Patrick Ruzand

In [30113]:

backport fix to 1.7.x, refs #16099,#14522 !strict

comment:3 Changed 7 years ago by Patrick Ruzand

In [30118]:

backport fix to 1.8.x, refs #16099 !strict

comment:4 Changed 7 years ago by Patrick Ruzand

In [30119]:

fix uagent for 1.8.x, refs #16099 !strict

comment:5 Changed 7 years ago by Patrick Ruzand

In [30120]:

fix uagent for 1.7.x, refs #16099 !strict

Note: See TracTickets for help on using tickets.