
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/


/**
 * AUTO-GENERATED FILE. DO NOT MODIFY.
 */

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
import { __extends } from "tslib";
import { Path } from '../graphic.js';
var DiagonalShape = /** @class */function () {
  function DiagonalShape() {
    this.points = [];
  }
  return DiagonalShape;
}();
var Diagonal = /** @class */function (_super) {
  __extends(Diagonal, _super);
  function Diagonal(opts) {
    var _this = _super.call(this, opts) || this;
    _this.type = 'diagonal';
    return _this;
  }
  Diagonal.prototype.getDefaultShape = function () {
    return new DiagonalShape();
  };
  Diagonal.prototype.buildPath = function (ctx, shape) {
    var points = shape.points;
    for (var index = 0; index < points.length; index++) {
      var _a = points[index],
        startPoint = _a[0],
        endPoint = _a[1];
      var startX = startPoint[0],
        startY = startPoint[1];
      var endX = endPoint[0],
        endY = endPoint[1];
      ctx.moveTo(startX, startY);
      ctx.lineTo(endX, endY);
    }
  };
  return Diagonal;
}(Path);
export default Diagonal;