Skip to content

Commit 20b5d7f

Browse files
committed
fix tranforming segments
1 parent eef780a commit 20b5d7f

File tree

1 file changed

+2
-3
lines changed
  • node-graph/gpath-bool/src

1 file changed

+2
-3
lines changed

node-graph/gpath-bool/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use graphene_core::vector::misc::{point_to_dvec2, transform_pathseg};
77
use graphene_core::vector::style::Fill;
88
use graphene_core::vector::{PointId, Vector};
99
use graphene_core::{Color, Ctx, Graphic};
10-
use kurbo::{ParamCurve, Point};
10+
use kurbo::{Affine, ParamCurve, Point};
1111
pub use path_bool as path_bool_lib;
1212
use path_bool::{FillRule, PathBooleanOperation};
1313
use std::ops::Mul;
@@ -300,8 +300,7 @@ fn to_path_segments(path: &mut Vec<path_bool::PathSegment>, subpath: &Subpath<Po
300300
let mut global_start = None;
301301
let mut global_end = Point::ZERO;
302302
for bezier in subpath.iter() {
303-
const EPS: f64 = 1e-8;
304-
let transformed = transform_pathseg(bezier, |pos| transform.transform_point2(pos).mul(EPS.recip()).round().mul(EPS));
303+
let transformed = Affine::new(transform.to_cols_array()) * bezier;
305304
let start = transformed.start();
306305
let end = transformed.end();
307306
if global_start.is_none() {

0 commit comments

Comments
 (0)