//
//  GSPath+Helper.h
//  GlyphsCore
//
//  Created by Georg Seifert on 29.09.23.
//  Copyright © 2023 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSPath.h>

NS_ASSUME_NONNULL_BEGIN

@interface GSPath (Helper)

/// Replaces a node range with a sharp corner fitted to the neighboring segments.
- (void)makeCornerFirstNodeIndex:(NSInteger)firstNodeIdx endNodeIndex:(NSInteger)endNodeIdx;

/// Opens an on-curve corner by the offset distance.
- (void)openCornerAtNode:(GSNode *)node offset:(CGFloat)offset;

#ifndef GLYPHS_LITE
/// Inserts an off-curve node into a quadratic segment.
///
/// Returns `nil` when the index range does not describe off-curve nodes in a quadratic segment.
- (nullable GSNode *)insertOffcurveWithStartIdx:(NSInteger)startIdx endIdx:(NSInteger)endIdx;

/// Removes an off-curve node range from a quadratic segment.
- (void)removeOffcurveWithStartIdx:(NSInteger)startIdx endIdx:(NSInteger)endIdx;
#endif

@end

NS_ASSUME_NONNULL_END
