youcef92 / flotr

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

Padding not allowed around canvas #162

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add some CSS padding to the div containing the canvas
2.
3.

What is the expected output? What do you see instead?
I expected to see padding around the canvas. Unfortunately, since it is 
absolutely positioned this didn't work.

What version of the product are you using? On what operating system?
r171, Windows Firefox 3.6

Please provide any additional information below.
I commented out this line:
c.style.cssText = 'position:absolute;left:0px;top:0px;';

This allowed padding to have its effect. It also appears to not break anything.
Attached patch with this change. 

Original issue reported on code.google.com by justin.f...@gmail.com on 14 Dec 2010 at 10:47

GoogleCodeExporter commented 8 years ago
I missed a part of the patch.
I also had to change how the canvas size was computed.

This may not be the most elegant solution.

Original comment by justin.f...@gmail.com on 14 Dec 2010 at 11:18

Attachments:

GoogleCodeExporter commented 8 years ago
I recommend putting a container around the canvas and giving that the required 
padding. You can use position: relative on it so that the canvas is positioned 
inside it.

If this is undesirable for some reason, please explain why and I can reopen the 
ticket for you.

Original comment by peter....@solide-ict.nl on 2 Feb 2011 at 1:29