
/*
* 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";
/* global Float32Array */
// TODO Batch by color
import * as graphic from '../../util/graphic.js';
// const BOOST_SIZE_THRESHOLD = 4;
var BoxesPathShape = /** @class */function () {
  function BoxesPathShape() {}
  return BoxesPathShape;
}();
var BoxesPath = /** @class */function (_super) {
  __extends(BoxesPath, _super);
  // private _ctx: CanvasRenderingContext2D;
  function BoxesPath(opts) {
    return _super.call(this, opts) || this;
  }
  BoxesPath.prototype.getDefaultShape = function () {
    return new BoxesPathShape();
  };
  BoxesPath.prototype.buildPath = function (path, shape) {
    var points = shape.points,
      fill = shape.fill,
      isWebviewRender = shape.isWebviewRender,
      stroke = shape.stroke;
    var hasFill = fill && fill !== 'none';
    var hasStroke = stroke && stroke !== 'none';
    for (var i = 0; i < points.length;) {
      var left = points[i++];
      var right = points[i++];
      var top_1 = points[i++];
      var bottom = points[i++];
      path.moveTo(left, top_1);
      path.lineTo(right, top_1);
      path.lineTo(right, bottom);
      path.lineTo(left, bottom);
      path.closePath();
      // if (i < points.length - 2) {
      //     hasFill && path.fillStyle(fill);
      //     hasStroke && path.strokeStyle(stroke); 
      //     path.beginPathFill();
      // }
    }
  };

  return BoxesPath;
}(graphic.Path);
export default BoxesPath;