cduck/drawsvg

Stupid question

Closed this issue · 1 comments

Hi,
I have tried various permutations to get the layout correct using the library.
My problem is very simple. I have a rectangular canvas which I know the width and height of.
On this canvas I want to draw a series of rectangles and have already calculated the x, y and width and height.
All my numbers are based on the canvas being having (0,0) in a corner and x and y are positive
No matter what I do I cannot get a any sensible coordinates
What am I doing wrong.

e.g. width of paper is 1980 height is 900. and I have some rectangles. What should I do to the values for them to draw as expected (5 long rectangles, stacked on top of one another with a break of gap of 25 between then with a small box in one of them)

Sorry for the stupid question, but I cannot see how to get this to plot as expected.

Cheers,

{'height': 150.0, 'width': 1972.0, 'x': 0.0, 'y': 150.0},
{'height': 36.0, 'width': 36.0, 'x': 68.0, 'y': 207.0}
{'height': 150.0, 'width': 1972.0, 'x': 0.0, 'y': 325.0},
{'height': 150.0, 'width': 1972.0, 'x': 0.0, 'y': 500.0},
{'height': 150.0, 'width': 1972.0, 'x': 0.0, 'y': 675.0},
{'height': 150.0, 'width': 1972.0, 'x': 0.0, 'y': 850.0}]

cduck commented

@Zeebzog Please include the code you tried and the output SVG. Otherwise I can't tell what is wrong.

You can also ask general "what am I doing wrong with this code" questions like this to stackoverflow.com.