typesettable
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -63,9 +63,12 @@ /** | ||
if (element.getBBox) { | ||
var _a = element.getBBox(), width = _a.width, height = _a.height; | ||
// copy to prevent NoModificationAllowedError | ||
return { width: width, height: height }; | ||
try { | ||
var _a = element.getBBox(), width = _a.width, height = _a.height; | ||
// copy to prevent NoModificationAllowedError | ||
return { width: width, height: height }; | ||
} | ||
catch (err) { | ||
} | ||
} | ||
else { | ||
return { height: 0, width: 0 }; | ||
} | ||
// if can't get valid bbox, return 0,0 | ||
return { height: 0, width: 0 }; | ||
}; | ||
@@ -72,0 +75,0 @@ return SvgUtils; |
{ | ||
"name": "typesettable", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "A typesetting library for SVG and Canvas", | ||
@@ -5,0 +5,0 @@ "main": "build/src/index.js", |
@@ -57,8 +57,13 @@ /** | ||
if (element.getBBox) { | ||
const { width, height } = element.getBBox(); | ||
// copy to prevent NoModificationAllowedError | ||
return { width, height }; | ||
} else { | ||
return { height: 0, width: 0 }; | ||
try { | ||
const { width, height } = element.getBBox(); | ||
// copy to prevent NoModificationAllowedError | ||
return { width, height }; | ||
} catch (err) { | ||
// swallow any errors that occur (Firefox Linux) | ||
} | ||
} | ||
// if can't get valid bbox, return 0,0 | ||
return { height: 0, width: 0 }; | ||
} | ||
@@ -65,0 +70,0 @@ } |
@@ -146,9 +146,12 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Typesetter = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
if (element.getBBox) { | ||
var _a = element.getBBox(), width = _a.width, height = _a.height; | ||
// copy to prevent NoModificationAllowedError | ||
return { width: width, height: height }; | ||
try { | ||
var _a = element.getBBox(), width = _a.width, height = _a.height; | ||
// copy to prevent NoModificationAllowedError | ||
return { width: width, height: height }; | ||
} | ||
catch (err) { | ||
} | ||
} | ||
else { | ||
return { height: 0, width: 0 }; | ||
} | ||
// if can't get valid bbox, return 0,0 | ||
return { height: 0, width: 0 }; | ||
}; | ||
@@ -155,0 +158,0 @@ return SvgUtils; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
197799
4068
0