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

maskWith does not work with <base> tag #36

Closed
chief3000 opened this issue May 15, 2013 · 3 comments
Closed

maskWith does not work with <base> tag #36

chief3000 opened this issue May 15, 2013 · 3 comments

Comments

@chief3000
Copy link

The svg.js works quite well and could be implemented quickly. Unfortunately, the mask seems to stop working as soon as you use the tag in the head. If this then refers to the root directory and the html file is in a subfolder. This applies with clip and maskWith.

greetings

@wout
Copy link
Member

wout commented May 15, 2013

Is this a svg.js issue or a svg issue? Have your tried writing svg manually to see if it does work without svg.js?

@chief3000
Copy link
Author

I think both. I must in any case make adjustments to svg.js. In this way it works now for me.

 SVG.extend(SVG.Element, {
    // Distribute mask to svg element
    maskWith: function(element) {   

      /* use given mask or create a new one */
      this.mask = element instanceof SVG.Mask ? element : this.parent.mask().add(element)
        if ($j.browser.msie)
        {
            return this.attr('mask', 'url(#' + this.mask.attr('id') + ')')
        }
        else
        {
            return this.attr('mask', 'url('+window.location+'#' +this.mask.attr('id') + ')')
        }
    }

  })

@wout
Copy link
Member

wout commented May 24, 2013

This is a very specific problem and can be solved as you suggested. I don't think it belongs to be part of the library. But thanks for the proposition.

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

2 participants