[Dojo-interest] Re: x and y coords of an Image Shape
Scott Stewart
williamscott.stewart at gmail.com
Thu Feb 8 13:57:56 MST 2007
Thanks Eugene....it was tested mainly on Firefox 2 cause thats were I
stepped through it with the debugger.
Please keep me posted
Eugene Lazutkin wrote:
> Scott,
>
> It looks like a bug to me. I'll check on it and let you know, when it is
> fixed.
>
> Thanks,
>
> Eugene
>
> Scott Stewart wrote:
>
>> Hi,
>>
>> Im still learning my way around the dojo gfx package, so please bear
>> with me. Below is some code that I wrote to try and determine if I move
>> past the edge of the surface.
>> I figured I would just chck the x any of the bounding box of the image
>> and compare the center.x against the width of the surface. However, the
>> bbox.y and bbox,x are always
>> 0. What did I do wrong? or Is there a preferred or easier way to
>> accomplish what Im trying to do..
>>
>>
>> var surf = gShapes[id].getParent();
>> var dim = surf.getDimensions();
>> var dimx = parseInt(dim.width);
>>
>> var bbox = gShapes[id].getBoundingBox();
>> var center =
>> dojo.gfx.matrix.multiplyPoint(gShapes[id].getTransform(), bbox.x,bbox.y);
>>
>> if (center.x > dimx) {
>> gShapes[id].applyTransform({cx: 0, dy: y});
>> }
>> else {
>> gShapes[id].applyTransform({dx: x, dy: y});
>> }
>>
>>
>> Scott
>>
>> _______________________________________________
>> Dojo FAQ: http://dojo.jot.com/FAQ
>> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
>> Dojo-interest at dojotoolkit.org
>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>>
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
More information about the Dojo-interest
mailing list