import '../../globals.js';
import { Shape } from '../../kite/js/imports.js';
import optionize from '../../phet-core/js/optionize.js';
import { Path } from '../../scenery/js/imports.js';
import sceneryPhet from './sceneryPhet.js';
export default class GridNode extends Path {
    /**
     * @param transformProperty
     * @param spacing - spacing between grid lines
     * @param center - center of the grid in model coordinates
     * @param numberOfGridLines - number of grid lines on each side of the center
     * @param [providedOptions]
     */
    constructor(transformProperty, spacing, center, numberOfGridLines, providedOptions) {
        const options = optionize()({
            stroke: 'gray'
        }, providedOptions);
        super(null, options);
        transformProperty.link((transform) => {
            const shape = new Shape();
            const x1 = -numberOfGridLines * spacing + center.x;
            const x2 = numberOfGridLines * spacing + center.x;
            const y1 = -numberOfGridLines * spacing + center.y;
            const y2 = numberOfGridLines * spacing + center.y;
            for (let i = -numberOfGridLines; i <= numberOfGridLines; i++) {
                const x = i * spacing + center.x;
                const y = i * spacing + center.y;
                shape.moveTo(x1, y).lineTo(x2, y); // horizontal lines
                shape.moveTo(x, y1).lineTo(x, y2); // vertical lines
            }
            this.shape = transform.modelToViewShape(shape);
        });
    }
}
sceneryPhet.register('GridNode', GridNode);
//# sourceMappingURL=GridNode.js.map