OK< I think there is a bug in .8. If you create the image control and set
the scale before you render it, it will scale properly. But once it is
rendered it will not change it's scale. Here is sample code that can be run
in the Playground to show it's behavior. If you run this in the 1.0.1
Playground it works as expected, but in the .8 Playground clicking the
button does nothing.
var doc = this.getRoot();
a = new qx.ui.basic.Image("http://img.constantcontact.com/ui/images1/safe_
subscribe_logo.gif");
a.setWidth(300);
a.setHeight(40);
doc.add(a);
a.setScale(false); // doesn't matter if you start scaled or not
var btn = new qx.ui.form.Button("Scale");
btn.addListener("click", function(){
a.toggleScale();
this.info("Scale=" + a.getScale());
});
doc.add(btn, {top:200, left:50});
Any workaround suggestions to make this work other then
destroying/recreating the image control every time I want to scale it?
Thanks,
Jim
On Fri, Mar 5, 2010 at 7:27 AM, Jim Hunter <[email protected]>wrote:
> Not related to that bug, but I did more testing and the actual scaling does
> work in .8 but when the image control is stuffed into the controls I have,
> that is when it fails. Today I am going to build up the control one piece at
> a time to see where the break occurs and report back.
>
> Thanks,
> Jim
>
>
> On Fri, Mar 5, 2010 at 12:50 AM, Alexander Steitz <
> [email protected]> wrote:
>
>> Hi Jim,
>>
>> is this issue related to the (already fixed) bug #3273?
>>
>> http://bugzilla.qooxdoo.org/show_bug.cgi?id=3273
>>
>> cheers,
>> Alex
>>
>> On Friday March 5 2010 01:28:56 Jim Hunter wrote:
>> > Does anyone know of a bug in the scaling of images in 0.8.x? I created a
>> > simple control to view an image or any other type of file that a browser
>> > can display and when I was testing it in the Playground (1.0.1) it
>> worked
>> > fine to scale the image. But when I put the control into my application
>> > (0.8.3) and tested it the scaling does nothing. The image stays the same
>> > size. It's as if it is just ignored. I know I need to move my app up to
>> > 1.01 but I have a release to get out and I can't spend the time on it
>> > right now.
>> >
>> > basically, I have a routine that scales the image to either fit
>> > horizontally or vertically depending on the size of the image. Here is a
>> > snipet that does the scaling, anyone see any room for improvement to get
>> > it to work in 0.8.x?
>> >
>> > this.page is a qx.ui.basic.Image
>> > this is a qx.ui.container.Scroll (also tried Composite with Canvas
>> layout)
>> >
>> > scaleMe : function(value)
>> > {
>> > if (value)
>> > {
>> > var pWidth = this.getBounds()["width"] - 2;
>> > var pHeight = this.getBounds()["height"] - 2;
>> > var myWidth = this.page.getBounds()["width"];
>> > var myHeight = this.page.getBounds()["height"];
>> > // calculate the ratios
>> > var rw = pWidth / myWidth;
>> > var rh = pHeight / myHeight;
>> > // determine which direction to scale to keep the aspect ratio
>> > if (rw > rh)
>> > {
>> > this.page.setHeight(pHeight);
>> > this.page.setWidth(Math.round(myWidth * rh));
>> > this.page.setScale(true);
>> > }
>> > else if (rh > rw)
>> > {
>> > this.page.setWidth(pWidth);
>> > this.page.setHeight(Math.round(myHeight * rh));
>> > this.page.setScale(true);
>> > }
>> > }
>> > else
>> > {
>> > this.page.setWidth(null);
>> > this.page.setHeight(null);
>> > this.page.setScale(false);
>> > }
>> > }
>> >
>> > this code works fine on 1.0.1
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>
>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel