Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setBackground not working #8

Open
dstainhauser opened this issue Jun 13, 2013 · 2 comments
Open

setBackground not working #8

dstainhauser opened this issue Jun 13, 2013 · 2 comments

Comments

@dstainhauser
Copy link

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

@Merenon
Copy link

Merenon commented Apr 10, 2014

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 ;)

@LingaTigeen
Copy link

@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");

rohanshiva pushed a commit to rohanshiva/Method-Draw that referenced this issue Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants