Giter VIP home page Giter VIP logo

Comments (7)

gabelerner avatar gabelerner commented on May 22, 2024

From [email protected] on April 04, 2010 16:27:00

Let's discuss since I believe that I implemented viewBox correctly per the spec
( http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute ). svg has a "width" and
"height" property which determine the canvas size. if not provided, you can fake them
on the test page (1000,600 by default) using the boxes. if in this example you set the
width/height property to 400,400 then you will get a circle. otherwise it does the
"stretch to fit" described in the spec. so either type width="600" height="600" into
the svg element or put 600,600 into the text boxes and you should see a circle.

p.s. cool android.svg :)

from canvg.

gabelerner avatar gabelerner commented on May 22, 2024

From [email protected] on April 04, 2010 16:30:05

ah, I believe you are right, this is really about preserveAspectRatio, see http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute since the default
value for preserveAspectRatio is midXMidY.

Take a look at the image in any browser (other than IE9)

Summary: preserveAspectRatio is not supported

from canvg.

gabelerner avatar gabelerner commented on May 22, 2024

From [email protected] on April 04, 2010 16:32:42

got it, thanks for the clarification! will add matrix transforms first (might refactor
that whole section) then look at this eventually so grab it if you want (set status to
started if you do).

from canvg.

gabelerner avatar gabelerner commented on May 22, 2024

From [email protected] on April 06, 2010 12:17:10

I'm made some decent progress on this yesterday night and today during lunch. I have
to support nested svg's and changing view ports which is taking a while but I'm close
to have the smiley face example working. Should be checked in tonight.

Status: Started
Owner: gabelerner

from canvg.

gabelerner avatar gabelerner commented on May 22, 2024

From [email protected] on April 06, 2010 12:21:08

Excellent news - you move fast!

from canvg.

gabelerner avatar gabelerner commented on May 22, 2024

From [email protected] on April 06, 2010 23:34:21

finally fixed in r37 check out the last example on the test page (same exact svg as in spec) and let me know
if you see any regressions!

Status: Fixed

from canvg.

pasestars avatar pasestars commented on May 22, 2024

I render a circle image using pattern, but it render not right.
<svg width="500" height="500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <pattern viewBox="0 0 1 1" patternContentUnits="objectBoundingBox" width="100%" height="100%" id="pattern"> <image id="svg_4" xlink:href="https://i.ibb.co/31PYDX5/maou.jpg" preserveAspectRatio="xMidYMid slice" width="1" height="1"/> </pattern> </defs> <circle id="sd" r="100" cy="100" cx="100" fill="url(#pattern)" /> </svg>
example

from canvg.

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.