[Dojo-interest] Re: Dojo 0.41 in IE : gfx images move when
another gfx shape is drawn outside of the surface area.
Aaron Staves
astaves at gmail.com
Fri Feb 9 15:49:58 MST 2007
well as a last ditch effort i thought i'd change the dojo.gfx image object
to a <v:image> object. It was surprisingly easy and worked beautifully.
I've submitted a patch if you'd like to look into this further, but this
fixes my problem at the moment and doesn't seem to break anything else.
Thanks again for all your help and insight Eugene.
My patch can be found at ticket #2438 in the tracker.
http://trac.dojotoolkit.org/ticket/2438
On 2/9/07, Eugene Lazutkin <eugene.lazutkin at gmail.com> wrote:
>
> Aaron Staves wrote:
> > The only difference i can see, is that it might be hard to integrate an
> > HTML
> > image into a vmlframe. Right now it appears that's the way that
> > dojo.gfxcreates an image shape. There's basically just a DIV with an
> > IMG inside of
> > it, and no vml. In my example, i actually used a vml version of the
> image
> > to get the image into the vmlframe. I assume the HTML image is
> preferred
> > because of the matrix transformations, or for some other reason?
>
> Yes, that is precisely the case. But it was not the reason for skipping
> on vmlframe. It may be a reason now.
>
> Thanks,
>
> Eugene
>
> >
> > Thanks again for looking into this.
> >
> > aaron.
> >
> > On 2/9/07, Eugene Lazutkin <eugene.lazutkin at gmail.com> wrote:
> >>
> >> I looked at vmlframe when we started and decided against using it. But
> >> now I don't recall the exact problem. Let me look into that again.
> >>
> >> Thanks,
> >>
> >> Eugene
> >>
> >> Aaron Staves wrote:
> >> > Thanks for the quick responses again Eugene. I hate to keep bringing
> >> this
> >> > topic up if it's pretty much set in stone that this is not possible
> >> using
> >> > IE; but i kind of find it hard to believe that there's no
> >> fix/workaround
> >> > for
> >> > this.
> >> >
> >> > In looking for a fix i came across a vmlframe shape (
> >> >
> >>
> http://msdn.microsoft.com/library/default.asp?url=/workshop/author/vml/SHAPE/VMLFRAME/e_vmlframe.asp
> ).
> >>
> >> >
> >> > Is this something that has been looked at for clipping VML elements?
> >> > Although i know pretty much nothing about creating VML without the
> >> > dojo.gfxlibrary, i've tried my best to illustrate this on a test
> >> > webpage (
> >> > http://aaron.schoolinsummertime.com/gfxVML/VML.html)
> >> >
> >> >
> >> > By default it looks like IE automatically turns clipping off; with or
> >> > without a vmlframe. Per the documentation "If *Clip* is *False*, the
> >> shape
> >> > will scale to fit the frame." This very obvious in my first two
> tests
> >> > where
> >> > you can see the original image is in fact smaller than the "after" or
> >> > second
> >> > image. So in my original bug that i found, it's not only the fact
> that
> >> the
> >> > image is moving up and to the left, but it is being scaled down as
> >> well.
> >> >
> >> > In the bottom 2, you see the original again, and below it is the
> object
> >> > in a
> >> > vmlframe. They look the same size because the surfaces are the same
> >> size,
> >> > yet the bottom one is merely a scaled down version of the shape that
> is
> >> > inside of it. If you click the "enable clipping" button, the frame
> >> will
> >>
> >> > then revert back to it's original scale, and correctly clip the
> >> line. If
> >> > you take clipping off again, some crazy stuff happens, but i just
> >> assume
> >> > you'd set clipping in the actual vmlframe for starters, as opposed to
> >> using
> >> > javascript for it. That seems to work fine. Now the way this is
> >> > implimented is kind of difficult to use.
> >> >
> >> > It looks like there can only be one src attribute for a vmlframe, so
> >> each
> >> > shape drawn would have to be put in a clipped vmlframe that is the
> size
> >> of
> >> > the surface that is in use. This may not be the case, as i am also
> >> looking
> >> > into how to incorporate multiple shapes in a single vmlframe.
> >> currently
> >> > i've only tried adding the actual "group" to the frame, but only the
> >> last
> >> > element seems to appear (which is the line). The other quirk is
> >> that it
> >> > seems that if you want to reference and object as the source of a
> >> vmlframe,
> >> > it needs to be already drawn (and visible) on the page. So if you
> make
> >> the
> >> > original copy not visible, the vmlframe reference is immediately made
> >> > invisible as well.
> >> >
> >> > Anyways, just let me know if you guys have looked at possible
> solutions
> >> and
> >> > i'm just bringing up old topics that maybe haven't made it to the
> >> mailing
> >> > lists since i've been on them. But this fix looks somewhat
> promising,
> >> and
> >> > i'll probably be playing around with it some more today. Thanks
> again!
> >> >
> >> > aaron
> >> >
> >> >
> >> >
> >> > On 2/8/07, Eugene Lazutkin <eugene.lazutkin at gmail.com> wrote:
> >> >>
> >> >> ASVG was not updated for many years now, it is unsupported by Adobe,
> >> and
> >> >> really buggy as it is. Unfortunately VML is the better choice on IE.
> >> >> Given the current state of decay of VML, I wouldn't be surprised if
> MS
> >> >> will implement SVG natively in the future.
> >> >>
> >> >> I understand the problem you are facing, and in most cases it is
> >> >> possible to solve it on the application level. Just clip
> >> coordinates to
> >> >> the surface manually, don't allow to drag stuff outside of it. For
> >> >> example I did it here:
> >> >> http://archive.dojotoolkit.org/nightly/demos/gfx/circles.html.
> Granted
> >> >> it is a simple case, but it can be done.
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Eugene
> >> >>
> >> >> Aaron Staves wrote:
> >> >> > ah, that's unfortunate. I've read a few threads about the ASVG
> >> plugin
> >> >> in
> >> >> > IE, is there currently any way to get IE7 (or 6) to correctly use
> >> that
> >> >> > plugin via dojo? It seems that suport for that was taken out of
> >> dojo
> >>
> >> >> > around
> >> >> > 5/9/2006 or at least out of the bootloader? or maybe ASVG was
> never
> >> >> > supported at all?
> >> >> >
> >> >> > I guess what i'm asking is - is there any way i can get dojo.gfxto
> >> >> > correctly utilize the ASVG plugin? I've tried forcing gfx to use
> >> svg
> >> >> IE7
> >> >> > fails upon creation. I'm just wondering if this would be a huge
> >> change
> >> >> to
> >> >> > the code or if it would just involve changing the creation of the
> >> >> actual
> >> >> > svg
> >> >> > surface. Also thanks for your quick reply Eugene!
> >> >> >
> >> >> > aaron
> >> >> >
> >> >> >
> >> >> > On 2/7/07, Eugene Lazutkin <eugene.lazutkin at gmail.com> wrote:
> >> >> >>
> >> >> >> This is a well-known problem. SVG clips everything on its
> "surface"
> >> >> >> boundary, while VML draws everything happily outside of a
> "surface"
> >> >> >> dynamically modifying its geometry. There is no work-around for
> >> that,
> >> >> >> and I don't think MS is going to fix VML any time soon --- from
> IE6
> >> to
> >> >> >> IE7 we saw a reduction in supported features. I suggest to do it
> in
> >> >> the
> >> >> >> application layer, e.g., don't allow users to draw shapes
> >> outside of
> >> a
> >> >> >> surface. It is a certifiable P.I.T.A., but it works.
> >> >> >>
> >> >> >> Thanks,
> >> >> >>
> >> >> >> Eugene
> >> >> >>
> >> >> >> Aaron Staves wrote:
> >> >> >> > This might be hard to explain, for starters lets say i have a
> gfx
> >> >> image
> >> >> >> at
> >> >> >> > x:0, y:0 (640x480) and on gfx surface (640px x 480px). From
> >> there,
> >> >> any
> >> >> >> > time
> >> >> >> > i draw a shape that exceeds the boundaries of the surface, say
> a
> >> >> line
> >> >> >> with
> >> >> >> > {x1:0, y1:0, x2:640, y2:480, width:100} or a circle {cx:200,
> >> cy:200,
> >> >> r:
> >> >> >> > 400}. This seems to 'cause the bounding area of the image
> >> >> (previously
> >> >> >> > 640x480) to extend beyond (or behind) the viewable surface. So
> >> now
> >> >> >> when
> >> >> >> > the
> >> >> >> > image redraws at 0,0, the 0,0 point of reference has changed
> from
> >> >> where
> >> >> >> it
> >> >> >> > was originally.
> >> >> >> >
> >> >> >> > I realize this is kind of hard to picture, so i've made a demo
> >> that
> >> >> can
> >> >> >> be
> >> >> >> > found here : http://aaron.schoolinsummertime.com/gfx/line.html.
> >> >> >> > Basically,
> >> >> >> > it should load a line that is overlayed on top of an
> image. Now
> >> if
> >> >> you
> >> >> >> > click "toggle line" that will 'cause the line to get wider, and
> >> you
> >> >> can
> >> >> >> see
> >> >> >> > the image move. When you click "toggle line" again, it will
> >> 'cause
> >> >> the
> >> >> >> > line
> >> >> >> > to get smaller, and the image will return to it's previous
> >> >> spot. Also
> >> >> >> keep
> >> >> >> > in mind, this only seems to be a problem with the VML side of
> >> gfx,
> >>
> >> >> the
> >> >> >> SVG
> >> >> >> > tests seem to work just fine; so this will only occur under
> >> IE7 or
> >> >> IE6.
> >> >> >> >
> >> >> >> > I'm just wondering if there is something i'm missing when
> >> creating
> >>
> >> >> >> > images on
> >> >> >> > the surface, or if this is in fact a bug in dojo.gfx. Any
> >> insight
> >> >> >> would
> >> >> >> be
> >> >> >> > greatly appreciated! thanks!
> >> >> >> >
> >> >> >> > aaron
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >>
> >>
> ------------------------------------------------------------------------
> >> >> >> >
> >> >> >> > _______________________________________________
> >> >> >> > 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
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >>
> ------------------------------------------------------------------------
> >> >> >
> >> >> > _______________________________________________
> >> >> > 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
> >> >>
> >> >
> >> >
> >> >
> >>
> ------------------------------------------------------------------------
> >>
> >> >
> >> > _______________________________________________
> >> > 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
> >>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070209/fe72b76b/attachment-0001.html
More information about the Dojo-interest
mailing list