TODO for Dojo2D

Web August 16th, 2006

After the long talk with Eugene, let me summarize the TODOs for the following weeks:

  • arcTo this is a required functionality listed in the proposal, but the proposed API is not quite clear
  • Unified setPath is almost done, just add arcTo later to make it complete
  • setTransform for VML this is the most difficult part, since VML render has subtle different behavior than the SVG render
  • group transformation since VML has lame support for the group transformation, only translate is supported, we might need to implement the transformation manually, or just cripple the group transform in both sides.
  • attachFoo functions in VML it is supposed to work by following the same approach in SVG.

Stroke bug in Dojo2D

Web August 16th, 2006

The strokes in VML and SVG are a little different, but noticeable. One picture is worthy one thousand words:

Storke bug


The default stroke style in VML is single black line according to the specification, while SVG is none. Why the first rounded stroke rects are different are still unknown.

Another interesting variance is the distance between the top of shape and table cell boundary.

Skewed rects bug in dojo2D

Web August 16th, 2006

Due to the difference of SVG and VML, the behaviors of Dojo 2D are not the same in all the test cases. I would demostrate the inconsistance here.

The left is the Internet Explorer Version 6.0.2900.2180.xpsp_sp2_gdr.050301-1519 in VMWare player, the right side is Mozilla Firefox 1.5.0.5 in Gentoo. This is the default testbed except where otherwise noted.

The test case snippet is:

addTest(‘skew_rect’, function(testName){
              surface = getTestSurface(testName, ‘skewed rects’ );
              // anonymous red rectangle
              surface.createRect().setRect(rect).setFill(new dojo.graphics.color.Color([255, 0, 0, 0.5])).
              // skew it around LB point -30d, rotate it around LB point 30d, and move it to (100, 100)
              setTransform(dojo.gfx.multiply(dojo.gfx.translate(100, 100), dojo.gfx.rotategAt(30, 0, 100), dojo.gfx.skewXgAt(-30, 0, 100)));
              // anonymous blue rectangle
              surface.createRect().setRect(rect).setFill(new dojo.graphics.color.Color([0, 0, 255, 0.5])).
              // skew it around LB point -30d, and move it to (100, 100)
              setTransform(dojo.gfx.multiply(dojo.gfx.translate(100, 100), dojo.gfx.skewXgAt(-30, 0, 100)));
              // anonymous yellow rectangle
              surface.createRect().setRect(rect).setFill(new dojo.graphics.color.Color([255, 255, 0, 0.25])).
              // move it to (100, 100)
              setTransform(dojo.gfx.translate(100, 100));
           });

The following screenshot demostrates the different behaviors of VML and SVG, I think the difference results from the rotation centers.

Skewed rects


UPDATE: Fixed by Eugene already. :-)

Dojo 2D in the SVN!

Web August 13th, 2006

Yes, the dojo 2D subsystem has been accepted by dojo SVN truck, which means it might be added to the next release. Proud to be the Dojo 2D contributer!

You may check out the code from here, and the test cases here. The API documentation is hosted here which is still evolving.

RSS feeds on th go

Desktop, Gentoo, Palm August 7th, 2006

I spend 3 – 5 hours for transportation weekly, and spend at least 40 minutes to browse/read the subscripted RSS feeds daily. What if I could utilize the trivial time in the metro to read something I am really interested in?

Here is one “just works” solution. Install Sunrise in the computer, and Plucker in the Palm. Export my favorite feeds from the RSS reader in OPML format, and import it to Sunrise which would synchronize the feeds and convert them to Plucker format later.

Import OPML

Download PDB files via kpilot to my Palm via IrDA. It works, but it involves in TOO MUCH interactivities with the users, you wanna catch the bus or not?

What I need is a cron job running in the background, check, convert and save. Whenever I do a HotSync, the files are updated; or just simply beam them to my Palm. Here is my proposal to work it around:

  • Develop a RSS fetcher/parser using RSS for Python to fetch the contents.
  • Develop a wrapper to invoke official Plucker Desktop to convert them to Plucker PDB
  • Develop a file synchronization plugin for KPilot
  • Customize a script to beam the files
  • Develop a init script to glue them together

Any suggestions?