PDA

View Full Version : [FIXED] Draggable Sprite Doesn't Follow Cursor



James Goddard
10 Aug 2011, 1:12 PM
REQUIRED INFORMATION

Ext version tested:

Ext 4.0 rev 5
Browser versions tested against:

Chrome 13.0.782.107 m
IE 8, 9
FF3
Description:

Draggable sprite does not follow cursor
Steps to reproduce the problem:

Run the included code
Click on the red circle sprite and drag it
The result that was expected:

Sprite follows cursor
The result that occurs instead:

Sprite gets further away from cursor the further away it is from the origin
On IE8 the sprite immeiately jumps away from the cursor signficantly
Test Case:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title id="page-title">Bug Example</title>
<link rel="stylesheet" type="text/css" href="/js/extjs-nls/resources/css/ext-all.css" />

<script type="text/javascript" src="/js/extjs-nls/ext-all-debug.js"></script>

<script type="text/javascript">
Ext.onReady (function () {
var dc = Ext.create ('Ext.draw.Component', {
region: 'center',
viewBox: true,
items: [
{ type: 'rect', fill: '#1111cc', x: 0, y: 0, width: 1000, height: 1000 },
{ id: 'circle', type: 'circle', fill: '#cc1111', x: 80, y: 80, radius: 5, width: 10, height: 10, listeners: { render: function (sprite) {
sprite.initDraggable ();
} } }
]
});

var vp = Ext.create ('Ext.container.Viewport', {
layout: 'border',
renderTo: Ext.getBody (),
items: [ dc ]
});
});
</script>
</head>
<body>
</body>
</html>

LesJ
11 Aug 2011, 8:41 AM
Please assign ticket number for this bug... fingers crossed this is fixed in the 4.1 release :s