Issue 64 in canviz: I think the BB is computing wrong

1 view
Skip to first unread message

can...@googlecode.com

unread,
Jul 18, 2010, 2:56:19 AM7/18/10
to canviz...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 64 by yobert: I think the BB is computing wrong
http://code.google.com/p/canviz/issues/detail?id=64

I was just looking through the source and it looks like there is a bug
where it computes the bounding box in canviz.js line 398. I've attached a
patch for your review...

Attachments:
canviz_bb_fix.patch 533 bytes

can...@googlecode.com

unread,
Jul 18, 2010, 3:27:13 AM7/18/10
to canviz...@googlegroups.com

Comment #1 on issue 64 by ryandesign.com: I think the BB is computing wrong
http://code.google.com/p/canviz/issues/detail?id=64

No, the code is correct as written. The parameters to the Rect function, as
seen in path.js, are left, top, right, bottom. In canvas coordinate space,
zero is at the top and coordinates increase as you go down, but in Graphviz
coordinate space, zero is at the bottom and coordinates increase as you go
up. That's why the second and fourth parameters (top and bottom,
respectively) have the Graphviz coordinate subtracted from the height of
the canvas -- to invert them.

What makes you think the code is incorrect?

can...@googlecode.com

unread,
Jul 18, 2010, 5:22:32 PM7/18/10
to canviz...@googlegroups.com

Comment #2 on issue 64 by yobert: I think the BB is computing wrong
http://code.google.com/p/canviz/issues/detail?id=64

Oh, I understand! Sorry about that, it just looked like a typo at first
glance. I should have dug deeper before submitting a report!

can...@googlecode.com

unread,
Jun 12, 2011, 11:40:01 PM6/12/11
to canviz...@googlegroups.com
Updates:
Status: Invalid

Comment #3 on issue 64 by ryandesi...@gmail.com: I think the BB is
computing wrong
http://code.google.com/p/canviz/issues/detail?id=64

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages