Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#4454 closed enhancement (fixed)

Precision loss in VML renderer

Reported by: Eugene Lazutkin Owned by: Eugene Lazutkin
Priority: high Milestone: 1.2
Component: DojoX GFX Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


VML accepts only integral values as coordinates. As a consequence it can accumulate errors especially for long relative segments. We need to find a way to make it more precise by pre-calculating all values independently and using the closest point to the real value.

Change History (10)

comment:1 Changed 13 years ago by Eugene Lazutkin

Status: newassigned

comment:2 Changed 12 years ago by Eugene Lazutkin

Milestone: 1.01.1

comment:3 Changed 12 years ago by Eugene Lazutkin

Milestone: 1.11.2

comment:4 Changed 12 years ago by guest


i think it might help to let you know how i worked around this one. I just drew the path at 1000 times the size I needed it, and then _transformed_ it...

M 2000,15 instead of M 2,0.015 transformation- xx: 0.001, yy: 0.001 (shrunk it back down)

But this is a heavy kludge. What is great is that VML is rendered to the thousandth pixel instead of single. Let me know if you want to see a working example.

bradley dott mccandless att gmail dott com [cla]

comment:5 Changed 12 years ago by Eugene Lazutkin

Milestone: 1.2future

Moving all open ticketd to the future.

comment:6 Changed 12 years ago by Eugene Lazutkin

Priority: normalhigh

comment:7 Changed 12 years ago by Eugene Lazutkin

Apparently the loss is in the VML itself rather in our VML renderer. There are two ways around it:

  1. Use Brandley's suggestion above.
  2. Do not generate any relative commands always using the absolute segments calculating absolute values ourselves.

Both solutions break the introspection (planned, but not fully implemented at the moment). Probably we should forget about 1-to-1 introspection of paths in this case. I am inclined to try the second solution myself because it doesn't involve any trickery, and has a potential to reduce the codebase somewhat.

comment:8 Changed 12 years ago by Eugene Lazutkin

(In [15160]) gfx: refs #4454, !strict; in order to improve the precision of the vml renderer all relative path commands are converted internally to use corresponding absolute commands; the path test is updated.

comment:9 Changed 12 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

Switching to absolute commands seems to improve the performance somewhat, reduced the codebase, and the code surface (== less code to debug).

This huge debug session highlighted bugs in VML's implementation of quadratic curves. Unfortunately the only way to improve that primitives is to approximate them with other primitives. This approach doesn't look practical though --- the abysmal performance of IE's JScript coupled with more math in JavaScript? code will negatively affect the performance of the renderer.

comment:10 Changed 12 years ago by Eugene Lazutkin

Milestone: future1.2
Note: See TracTickets for help on using tickets.