PDA

View Full Version : Constraints on scrollable scaled image



mmigdol
9 Feb 2011, 11:45 AM
Hi all,

I'm trying to create a scrollable image panel. I'm setting the scale of the image with a CSS transform. However, the constraints of the scroller are getting set incorrectly. In the following simple example, the top and left constraints are both being set to 0. However, the origin of the image is the center of the image -- as a result, I can pan up and/or left, but not down/right.

Ext.setup({
onReady: function(){
var p = new Ext.Panel({
id: 'panel',
scroll: 'both',
fullscreen: true,
items: [
{
id: 'photo',
html : '<img src="large.jpg">'
}
],
listeners: {
afterrender : function() {
var style = 'scale(' + 2.0 + ')';
var el = Ext.get('photo');
el.setStyle('-webkit-transform', style);
}
}
});
}
});
I tried calling panel.scroller.updateBoundary() after scaling the image, but this did not work.

Any advice? Thanks in advance...

themightychris
18 Jun 2011, 9:31 AM
I'm encountering the same issue, did you ever work out a solution?