Method-Draw icon indicating copy to clipboard operation
Method-Draw copied to clipboard

setBackground not working

Open dstainhauser opened this issue 11 years ago • 2 comments

Hi

I try to set a background image with
svgCanvas.setBackground('', url) on the iFrame content; But the image never appears. The same operation works fine with the original svg-editor.

The problem seems to be the white background that is added to the content as a default.

How can I get rid of this? Is there a way to configure the background? If I have to change the javascript files, how can I create the compiled version again?

Thanks for any help. I really like the method-draw editor, as it is much more usable on the iPad.

Regards

Daniel

dstainhauser avatar Jun 13 '13 21:06 dstainhauser

Hi dstainhauser,

This post is a bit old, but maybe it will help someone else.

Method-Draw seems to create a separate layer for the background, therefore the "original background" is hidden. Changing line 1316 from

if (!document.getElementById('canvas_background')) createBackground(); to if (!document.getElementById('canvas_background')) createBackground("none");

seems to work. Maybe you can even completely remove that background layer.

Hope that helps somehow ;)

Merenon avatar Apr 10 '14 07:04 Merenon

@Merenon Thanks, the below change worked for me. It was on the line 1186 in the recent version

if (!document.getElementById('canvas_background')) createBackground("none");

LingaTigeen avatar Dec 04 '19 14:12 LingaTigeen