Merge pull request #432 from Grigoletti2001/master

updating documentation from W3 to MDN for Aspect Ratio
master
JFH 2020-09-09 13:42:22 +02:00 committed by GitHub
commit 90cd59cae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -670,7 +670,8 @@ function build (opts) {
// aspect ratio // aspect ratio
svg.AspectRatio = function (ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY) { svg.AspectRatio = function (ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY) {
// aspect ratio - https://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute //aspect ratio -https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio
aspectRatio = svg.compressSpaces(aspectRatio); aspectRatio = svg.compressSpaces(aspectRatio);
aspectRatio = aspectRatio.replace(/^defer\s/, ''); // ignore defer aspectRatio = aspectRatio.replace(/^defer\s/, ''); // ignore defer
const align = aspectRatio.split(' ')[0] || 'xMidYMid'; const align = aspectRatio.split(' ')[0] || 'xMidYMid';