Removing excanvas from WireIt

76 views
Skip to first unread message

John Osborne

unread,
May 10, 2012, 9:12:55 PM5/10/12
to WireIt
Is it possible to use fxcanvas or flashcanvas instead of excanvas? I
have a web-app that sometimes loads many canvas elements (roughly
250-300). In IE8, using excanvas, it takes 4 minutes to load and
sometimes crashes the browser. In a browser with native canvas
support, such as FF, it takes 5 seconds to load. Since excanvas
performance degrades with more elements on the page, I have seen as
long as 6 seconds to run the canvas stroke function with a lot of
elements being drawn at once.

I tried replacing excanvas with fxcanvas and flashcanvas out of the
box but neither worked. My wires will just not show up on the canvas.

I looked at the underlying code in WireIt and it seems that all of the
canvas functionality is supported by fxcanvas and flashcanvas, so I
have no idea why its not working.

Has this ever been tried?

Thanks very much,

John

John Osborne

unread,
May 29, 2012, 12:35:29 PM5/29/12
to WireIt
WireIt Community,

I did resolve this issue. In order to use flashcanvas with WireIt
instead of excanas do the following:
- Include FlashCanvas.js, remove includes to excanvas.js
- Change all instances of
if(typeof (G_vmlCanvasManager) !="undefined"){
this.element=G-vmlCanvasManager.initElement(this.element);
}

to

if(typeof (FlashCanas != "undefined"){
this.element=FlashCanvas.initElement(this.element);
}

In my app I found references in wiring-editor.js, wireit.js. wireit-
min.js, canvas.text.js, CanvasElement.js

- Finally, if you are resizing your canvas using wire.setCanvasRegion
will not work. WireIt wire class inherits from the CanvasElement
class so presumably the method will not work for CanvasElement
either. You need to manipulate wire.getContext().canvas.width &
wire.getContext().canvas.height to resize the canvas.

I found in general there was a pretty big performance improvement
although it is still much much slower than using a browser with built-
in HTML5 Canvas functionality such as IE9, FireFox, or Chrome
Reply all
Reply to author
Forward
0 new messages