PDA

View Full Version : [CLOSED] [4.1.2] Unable to drag sprite after setViewBox



wsi
31 Jan 2013, 8:31 AM
REQUIRED INFORMATION
Ext version tested:

Ext.4.1.2
Ext.4.1.3
Ext 4.2.0.179
Browser:

Chrome 24.0.1312.52 m
Description:

Setting an Ext.draw.Sprite to draggable and adding it to to the surface allows you to drag the sprite around. However, after doing a surface.setViewBox to a smaller view, only the top left corner of the sprite is draggable.
Steps to reproduce the problem:

Create a draw.Component.
Create a sprite and add it to the draw.Component.
Set the viewbox of the draw.Component's surface to a smaller view.
The result that was expected:

A sprite that is draggable
The result that occurs instead:

A sprite that is only draggable from the top left corner.
Test Case:


var drawComponent = Ext.create('Ext.draw.Component', {});

Ext.create('Ext.Window', {
width: 500,
height: 200,
layout: 'fit',
items: [drawComponent]
}).show();

var circle = Ext.create( 'Ext.draw.Sprite', {
type: 'rect',
draggable: true,
fill: '#79BB3F',
x: 10,
y: 10,
width: 50,
height: 25
});
drawComponent.surface.add( circle );

drawComponent.surface.setViewBox( 0, 0, 50, 50 );

mitchellsimoens
31 Jan 2013, 10:57 AM
Thanks for the report! I have opened a bug in our bug tracker.