<commit_before><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>SVG rendering — Fabric.js demos</title>
    <script src="../../dist/all.js"></script>
    <style>
      #bd-wrapper { text-align: center; }
      .canvas-container { border: 1px solid #ccc; display: inline-block; vertical-align: top; margin-bottom: 10px; background: #fff; }
      h2 span { font-weight: normal; }
      .block { float: left; margin-right: 10px; margin-bottom: 10px }
      .block.left { clear: left; }
      .test { background: #ccc; margin-right: 10px; margin-bottom: 10px; padding-left: 10px; 
        box-shadow: rgba(0,0,0,0.5) 1px 1px 3px; overflow: hidden; display: inline-block; }
      iframe { background: #fff; border: 0; max-width: 600px }
    </style>
    <link rel="stylesheet" href="../../lib/master.css" type="text/css">
    <script>
      function toShape(objects, options) {
        if (objects.length > 1) {
          return new fabric.PathGroup(objects, options);
        }
        return objects[0];
      }
    </script>
    <script>
      function initCanvas(id) {
        var canvas;
        fabric.loadSVGFromURL('../kitchensink/assets/' + id + '.svg', function(objects, options) {
          var shape = toShape(objects, options);
          
          var canvasEl = document.getElementById('c' + id);
          canvasEl.width = shape.width || 600;
          canvasEl.height = shape.height || 600;
          
          canvas = window['__canvas' + id] = new fabric.Canvas('c' + id, { selection: false });
          
          canvas.add(shape).centerObjectH(shape).centerObjectV(shape).renderAll();
          shape.setCoords();
          canvas.calcOffset();
        });
      }
    </script>
  </head>
  <body>
    <ul id="header">
      <li><a href="../index.html">Demos</a></li>
      <li><a href="../../benchmarks/index.html">Benchmarks</a></li>
      <li><a href="../../docs/index.html">Docs</a></li>
      <li><a href="../../test/unit/suite_runner.html">Tests</a></li>
    </ul>
    <div id="bd-wrapper">

      <h2><span>Fabric.js demos</span> &middot; SVG rendering</h2>
      <commit_msg>Set dimensions of iframes in svg rendering demo.<commit_after><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>SVG rendering — Fabric.js demos</title>
    <script src="../../dist/all.js"></script>
    <style>
      #bd-wrapper { text-align: center; }
      .canvas-container { border: 1px solid #ccc; display: inline-block; vertical-align: top; margin-bottom: 10px; background: #fff; }
      h2 span { font-weight: normal; }
      .block { float: left; margin-right: 10px; margin-bottom: 10px }
      .block.left { clear: left; }
      .test { background: #ccc; margin-right: 10px; margin-bottom: 10px; padding-left: 10px; 
        box-shadow: rgba(0,0,0,0.5) 1px 1px 3px; overflow: hidden; display: inline-block; }
      iframe { background: #fff; border: 0; max-width: 600px }
    </style>
    <link rel="stylesheet" href="../../lib/master.css" type="text/css">
    <script>
      function toShape(objects, options) {
        if (objects.length > 1) {
          return new fabric.PathGroup(objects, options);
        }
        return objects[0];
      }
    </script>
    <script>
      function initCanvas(id) {
        var canvas;
        fabric.loadSVGFromURL('../kitchensink/assets/' + id + '.svg', function(objects, options) {
          var shape = toShape(objects, options);
          
          var canvasEl = document.getElementById('c' + id);
          
          canvasEl.width = shape.width || 600;
          canvasEl.height = shape.height || 600;
          
          var iframeEl = canvasEl.parentNode.nextSibling.childNodes[1];
          if (iframeEl) {
            iframeEl.style.width = canvasEl.width + 'px';
            iframeEl.style.height = canvasEl.height + 'px';
          }
          
          canvas = window['__canvas' + id] = new fabric.Canvas('c' + id, { selection: false });
          
          canvas.add(shape).centerObjectH(shape).centerObjectV(shape).renderAll();
          shape.setCoords();
          canvas.calcOffset();
        });
      }
    </script>
  </head>
  <body>
    <ul id="header">
      <li><a href="../index.html">Demos</a></li>
      <li><a href="../../benchmarks/index.html">Benchmarks</a></li>
      <li><a href="../../docs/index.html">Docs</a></li>
      <li><a href="../../test/unit/suite_runner.html">Tests</a></li>
    </ul>
    <div id="bd-wrapper">

      <h2><span>Fabric.js demos</span> &middot; SVG rendering</h2>
      
{'fraction_non_alphanumeric': 0.17479585080556168, 'fraction_numerical': 0.01655263738689031, 'mean_word_length': 2.2936046511627906, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1184472', 'n_tokens_mistral': 1523, 'n_tokens_neox': 1440, 'n_words': 306}