jinlin
2024-09-26 7ec9326ce00d08f9d957981f2edff6df26f24a28
web/public/SVGOrigin/Method-Draw-master/editor/src/svgtransformlist.js
@@ -57,12 +57,12 @@
// **************************************************************************************
// SVGTransformList implementation for Webkit
// SVGTransformList implementation for Webkit
// These methods do not currently raise any exceptions.
// These methods also do not check that transforms are being inserted.  This is basically
// implementing as much of SVGTransformList that we need to get the job done.
//
//  interface SVGEditTransformList {
//  interface SVGEditTransformList {
//    attribute unsigned long numberOfItems;
//    void   clear (  )
//    SVGTransform initialize ( in SVGTransform newItem )
@@ -93,7 +93,7 @@
    // Transform attribute parser
    var str = this._elem.getAttribute("transform");
    if(!str) return;
    // TODO: Add skew support in future
    var re = /\s*((scale|matrix|rotate|translate)\s*\(.*?\))\s*,?\s*/;
    var arr = [];
@@ -119,7 +119,7 @@
        var xform = svgroot.createSVGTransform();
        var fname = 'set' + name.charAt(0).toUpperCase() + name.slice(1);
        var values = name=='matrix'?[mtx]:val_arr;
        if (name == 'scale' && values.length == 1) {
          values.push(values[0]);
        } else if (name == 'translate' && values.length == 1) {
@@ -153,26 +153,26 @@
      }
    }
  };
  this.numberOfItems = 0;
  this.clear = function() {
  this.clear = function() {
    this.numberOfItems = 0;
    this._xforms = [];
  };
  this.initialize = function(newItem) {
    this.numberOfItems = 1;
    this._removeFromOtherLists(newItem);
    this._xforms = [newItem];
  };
  this.getItem = function(index) {
    if (index < this.numberOfItems && index >= 0) {
      return this._xforms[index];
    }
    throw {code: 1}; // DOMException with code=INDEX_SIZE_ERR
  };
  this.insertItemBefore = function(newItem, index) {
    var retValue = null;
    if (index >= 0) {
@@ -198,7 +198,7 @@
    }
    return retValue;
  };
  this.replaceItem = function(newItem, index) {
    var retValue = null;
    if (index < this.numberOfItems && index >= 0) {
@@ -209,7 +209,7 @@
    }
    return retValue;
  };
  this.removeItem = function(index) {
    if (index < this.numberOfItems && index >= 0) {
      var retValue = this._xforms[index];
@@ -228,7 +228,7 @@
      throw {code: 1}; // DOMException with code=INDEX_SIZE_ERR
    }
  };
  this.appendItem = function(newItem) {
    this._removeFromOtherLists(newItem);
    this._xforms.push(newItem);
@@ -288,4 +288,4 @@
};
})();
})();