Git Product home page Git Product logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
Yes. This is an item that is on my todo list.

Original comment by [email protected] on 28 Aug 2013 at 2:55

  • Changed state: Accepted

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024

Original comment by [email protected] on 8 Jul 2014 at 8:50

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
Issue 41 has been merged into this issue.

Original comment by [email protected] on 8 Jul 2014 at 8:51

from androidsvg.

BigBadaboom avatar BigBadaboom commented on May 30, 2024

Fixed.

Added the ability to hide all but a specified element when rendering an SVG.
We support this by adding support for the ":not()" pseudo class to the CSS subsystem.

I also added support for all other Selectors Level 3 pseudo classes. We already supported :first-child. But now we also
fully support: :target, :root, :nth_child, :nth_last_child, :nth_of_type, :nth_last_of_type, :first_child, :last_child,
:first_of_type, :last_of_type, :only_child, :only_of_type, :empty, :not. In addition, the following pseudo classes
are recognised, but always fail to match, because they are not currently useful: :lang, :link, :visited, :hover,
:active, :focus, :enabled, :disabled, :checked, :indeterminate.

I also added support for setting the element that is used for matching the :target pseudo class. Use the new target()
method in RenderOptions.

from androidsvg.

BigBadaboom avatar BigBadaboom commented on May 30, 2024

To render only a specific element in your SVG, you can do something like the following:

RenderOptions renderOptions = RenderOptions.create().css("svg :not(#myElement) { display: none; }");
svg.renderToCanvas(canvas, renderOptions);

or you could do something like the following:

  RenderOptions renderOptions = RenderOptions.create().css("svg :not(:target) { display: none; }");
  renderOptions.target("myElement");
  svg.renderToCanvas(canvas, renderOptions);

from androidsvg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.