import '../../../globals.js';
// Copyright 2023-2024, University of Colorado Boulder
/**
 * A single loop of a RenderPath, with computed bounds.
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import Bounds2 from '../../../dot/js/Bounds2.js';
import { alpenglow } from '../imports.js';
export default class BoundedSubpath {
    constructor(path, subpath) {
        this.path = path;
        this.subpath = subpath;
        this.bounds = Bounds2.NOTHING.copy();
        for (let i = 0; i < subpath.length; i++) {
            this.bounds.addPoint(subpath[i]);
        }
    }
    static fromPathSet(paths) {
        const subpaths = [];
        for (const path of paths) {
            for (const subpath of path.subpaths) {
                subpaths.push(new BoundedSubpath(path, subpath));
            }
        }
        return subpaths;
    }
}
alpenglow.register('BoundedSubpath', BoundedSubpath);
//# sourceMappingURL=BoundedSubpath.js.map