tobiasrau88 / canviz

Automatically exported from code.google.com/p/canviz
0 stars 0 forks source link

I think the BB is computing wrong #64

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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...

Original issue reported on code.google.com by yob...@gmail.com on 18 Jul 2010 at 6:55

Attachments:

GoogleCodeExporter commented 8 years ago
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?

Original comment by ryandesi...@gmail.com on 18 Jul 2010 at 7:26

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

Original comment by yob...@gmail.com on 18 Jul 2010 at 9:21

GoogleCodeExporter commented 8 years ago

Original comment by ryandesi...@gmail.com on 13 Jun 2011 at 3:38