Comments (7)
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.
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.
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.
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.
From [email protected] on April 06, 2010 12:21:08
Excellent news - you move fast!
from canvg.
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.
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>
from canvg.
Related Issues (20)
- [Bug]: Offscreen sample not working (I fixed) HOT 1
- [Bug]: text color does not appear (it works)
- [Bug]: Infinite loop in the Canvg HOT 1
- [Bug]: v3+ rendered incorrectly HOT 2
- [Bug]: render position error
- [Bug]: `rotate` angle units are ignored
- Rendering SVG animations in Node
- [Bug]: canvg.resize(...) doesn't work on SVGs with no viewbox HOT 1
- [Bug]: Simple SVG is not rendering
- [Bug]: There is a difference in the generated content
- how to introduce with html page using script tag directly? HOT 1
- Set minimum workflow permissions HOT 2
- [Bug]: Screenshot why no text is displayed
- [Bug]: DOMException: Failed to execute 'matches' on 'Element': 'child-active):focus-within .n-menu-item-content__icon' is not a valid selector.
- [Bug]: mask render incorrectly when with viewbox HOT 1
- [Bug]: SVG not RENDERING
- Replace xmldom with @xmldom/xmldom to fix critical vulnerability HOT 1
- [Bug]: filter - feColorMatrix shift-column not working
- [Bug]: filter chain - result/in ignored
- [Bug]: Rendering issue of path
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canvg.