fn render_defs(&self, svg_defs: &mut String, multiplied_transform: DAffine2, bounds: [DVec2; 2], transformed_bounds: [DVec2; 2]) {
		let bound_transform = DAffine2::from_scale_angle_translation(bounds[1] - bounds[0], 0., bounds[0]);
		let transformed_bound_transform = DAffine2::from_scale_angle_translation(transformed_bounds[1] - transformed_bounds[0], 0., transformed_bounds[0]);
		let updated_transform = multiplied_transform * bound_transform;

		let positions = self
			.positions
			.iter()
			.filter_map(|(pos, color)| color.map(|color| (pos, color)))
			.map(|(position, color)| format!(r##"<stop offset="{}" stop-color="#{}" />"##, position, color.rgba_hex()))
			.collect::<String>();

		let mod_gradient = transformed_bound_transform.inverse();
		let mod_points = mod_gradient.inverse() * transformed_bound_transform.inverse() * updated_transform;

		let start = mod_points.transform_point2(self.start);
		let end = mod_points.transform_point2(self.end);

		let transform = mod_gradient
			.to_cols_array()
			.iter()
			.enumerate()
			.map(|(i, entry)| entry.to_string() + if i == 5 { "" } else { "," })
			.collect::<String>();

		let _ = write!(
			svg_defs,
			r#"<linearGradient id="{}" x1="{}" x2="{}" y1="{}" y2="{}" gradientTransform="matrix({})">{}</linearGradient>"#,
			self.uuid, start.x, end.x, start.y, end.y, transform, positions
		);
	}
/// Adds the gradient def with the uuid specified
Adds the gradient def with the uuid specified
Adds the gradient def with the uuid specified
fn render_defs(&self, svg_defs: &mut String, multiplied_transform: DAffine2, bounds: [DVec2; 2], transformed_bounds: [DVec2; 2]) {
		let bound_transform = DAffine2::from_scale_angle_translation(bounds[1] - bounds[0], 0., bounds[0]);
		let transformed_bound_transform = DAffine2::from_scale_angle_translation(transformed_bounds[1] - transformed_bounds[0], 0., transformed_bounds[0]);
		let updated_transform = multiplied_transform * bound_transform;
		let positions = self
			.positions
			.iter()
			.filter_map(|(pos, color)| color.map(|color| (pos, color)))
			.map(|(position, color)| format!(r##"<stop offset="{}" stop-color="#{}" />"##, position, color.rgba_hex()))
			.collect::<String>();
		let mod_gradient = transformed_bound_transform.inverse();
		let mod_points = mod_gradient.inverse() * transformed_bound_transform.inverse() * updated_transform;
		let start = mod_points.transform_point2(self.start);
		let end = mod_points.transform_point2(self.end);
		let transform = mod_gradient
			.to_cols_array()
			.iter()
			.enumerate()
			.map(|(i, entry)| entry.to_string() + if i == 5 { "" } else { "," })
			.collect::<String>();
		let _ = write!(
			svg_defs,
			r#"<linearGradient id="{}" x1="{}" x2="{}" y1="{}" y2="{}" gradientTransform="matrix({})">{}</linearGradient>"#,
			self.uuid, start.x, end.x, start.y, end.y, transform, positions
		);
	}
fn render_defs ( & self , svg_defs : & mut String , multiplied_transform : DAffine2 , bounds : [ DVec2 ; 2 ] , transformed_bounds : [ DVec2 ; 2 ] ) { let bound_transform = DAffine2 :: from_scale_angle_translation ( bounds [ 1 ] - bounds [ 0 ] , 0. , bounds [ 0 ] ) ; let transformed_bound_transform = DAffine2 :: from_scale_angle_translation ( transformed_bounds [ 1 ] - transformed_bounds [ 0 ] , 0. , transformed_bounds [ 0 ] ) ; let updated_transform = multiplied_transform * bound_transform ; let positions = self . positions . iter ( ) . filter_map ( | ( pos , color ) | color . map ( | color | ( pos , color ) ) ) . map ( | ( position , color ) | format ! ( r##"<stop offset="{}" stop-color="#{}" />"## position color rgba_hex ( ) ) ) . collect :: < String > ( ) ; let mod_gradient = transformed_bound_transform . inverse ( ) ; let mod_points = mod_gradient . inverse ( ) * transformed_bound_transform . inverse ( ) * updated_transform ; let start = mod_points . transform_point2 ( self . start ) ; let end = mod_points . transform_point2 ( self . end ) ; let transform = mod_gradient . to_cols_array ( ) . iter ( ) . enumerate ( ) . map ( | ( i , entry ) | entry . to_string ( ) + if i == 5 { " " } else { " " } ) . collect :: < String > ( ) ; let _ = write ! ( svg_defs r#"<linearGradient id="{}" x1="{}" x2="{}" y1="{}" y2="{}" gradientTransform="matrix({})">{}</linearGradient>"# self uuid start x end x start y end y transform positions ) ; }
Adds the gradient def with the uuid specified
Adds the gradient def with the uuid specified
&self
svg_defs
&mut String
multiplied_transform
DAffine2
bounds
[DVec2; 2]
transformed_bounds
[DVec2; 2]
&self
svg_defs
&mut String
multiplied_transform
DAffine2
bounds
[DVec2; 2]
transformed_bounds
[DVec2; 2]