Skip to content

Commit 16ac559

Browse files
committed
Only under spline mode
1 parent 3ecbd0f commit 16ac559

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmdapp/src/converter.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ use super::config::{ColorMode, Config, ConverterConfig, Hierarchical};
55
use super::svg::SvgFile;
66
use fastrand::Rng;
77
use visioncortex::color_clusters::{KeyingAction, Runner, RunnerConfig, HIERARCHICAL_MAX};
8-
use visioncortex::{approximate_circle_with_spline, Color, ColorImage, ColorName, CompoundPath};
8+
use visioncortex::{
9+
approximate_circle_with_spline, Color, ColorImage, ColorName, CompoundPath, PathSimplifyMode,
10+
};
911

1012
const NUM_UNUSED_COLOR_ITERATIONS: usize = 6;
1113
/// The fraction of pixels in the top/bottom rows of the image that need to be transparent before
@@ -169,7 +171,8 @@ fn color_image_to_svg(mut img: ColorImage, config: ConverterConfig) -> Result<Sv
169171
let mut svg = SvgFile::new(width, height, config.path_precision);
170172
for &cluster_index in view.clusters_output.iter().rev() {
171173
let cluster = view.get_cluster(cluster_index);
172-
let paths = if cluster.rect.width() < SMALL_CIRCLE
174+
let paths = if matches!(config.mode, PathSimplifyMode::Spline)
175+
&& cluster.rect.width() < SMALL_CIRCLE
173176
&& cluster.rect.height() < SMALL_CIRCLE
174177
&& cluster.to_shape(&view).is_circle()
175178
{

0 commit comments

Comments
 (0)