Skip to content

Commit

Permalink
feat: support css box on root svg node
Browse files Browse the repository at this point in the history
  • Loading branch information
TremayneChrist committed Dec 31, 2019
1 parent 042507a commit 027adda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/algorithms/calculateBoxSize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const calculateBoxSizes = (target: Element): ResizeObserverSizeCollection => {

const cs = getComputedStyle(target);

// If element is an SVG, handle things differently, using its bounding box.
const svg = isSVG(target) && (target as SVGGraphicsElement).getBBox();
// If element has an SVG box, handle things differently, using its bounding box.
const svg = isSVG(target) && !(target as SVGElement).ownerSVGElement && (target as SVGGraphicsElement).getBBox();

// IE does not remove padding from width/height, when box-sizing is border-box.
const removePadding = !IE && cs.boxSizing === 'border-box';
Expand Down

0 comments on commit 027adda

Please sign in to comment.