Opened 12 years ago

Closed 12 years ago

#4551 closed defect (invalid)

division by 0 error

Reported by: guest Owned by: Eugene Lazutkin
Priority: high Milestone: 1.0
Component: DojoX GFX Version: 0.9
Keywords: applyTransform "divison by 0" vml gfx Cc:
Blocked By: Blocking:

Description

File : dojox/gfx/vml.js Method : _applyTransform Line : 220

var origin = (-l / w - 0.5).toFixed(8) + " " + (-t / h - 0.5).toFixed(8);

if w = 0, we get a -1 / 0, which return "-Infinity"

Then, skew.origin = origin;

returns an error

I suppose we wanted to do this ? :

var origin = (-l / (w - 0.5)).toFixed(8) + " " + (-t / h - 0.5).toFixed(8);

Change History (2)

comment:1 Changed 12 years ago by Adam Peller

Milestone: 1.0

comment:2 Changed 12 years ago by Eugene Lazutkin

Resolution: invalid
Status: newclosed

Actually it does what it supposed to do: (-0.5, -0.5) means "top-left corner", (+0.5, +0.5) means "bottom-right corner", (0, 0) means "center of the shape" --- VML uses the "shape-based" coordinate system.

w and h are not supposed to be 0 --- what kind of shape has 0 size? If any of them 0, VML breaks even without help from dojox.gfx.

I am closing this ticket as invalid.

Note: See TracTickets for help on using tickets.