pub fn transform(&mut self, buffer: &mut Vec<Message>) {
		let transform = transform_from_box(self.bounds[0], self.bounds[1], self.transform).to_cols_array();
		let path = self.bounding_box.clone();
		buffer.push(DocumentMessage::Overlays(Operation::SetLayerTransformInViewport { path, transform }.into()).into());

		// Helps push values that end in approximately half, plus or minus some floating point imprecision, towards the same side of the round() function
		const BIAS: f64 = 0.0001;

		for (position, path) in self.evaluate_transform_handle_positions().into_iter().zip(&self.transform_handles) {
			let scale = DVec2::splat(VECTOR_MANIPULATOR_ANCHOR_MARKER_SIZE);
			let translation = (position - (scale / 2.) - 0.5 + BIAS).round();
			let transform = DAffine2::from_scale_angle_translation(scale, 0., translation).to_cols_array();
			let path = path.clone();
			buffer.push(DocumentMessage::Overlays(Operation::SetLayerTransformInViewport { path, transform }.into()).into());
		}
	}
/// Update the position of the bounding box and transform handles
Update the position of the bounding box and transform handles
Update the position of the bounding box and transform handles
pub fn transform(&mut self, buffer: &mut Vec<Message>) {
		let transform = transform_from_box(self.bounds[0], self.bounds[1], self.transform).to_cols_array();
		let path = self.bounding_box.clone();
		buffer.push(DocumentMessage::Overlays(Operation::SetLayerTransformInViewport { path, transform }.into()).into());
		// Helps push values that end in approximately half, plus or minus some floating point imprecision, towards the same side of the round() function
		const BIAS: f64 = 0.0001;
		for (position, path) in self.evaluate_transform_handle_positions().into_iter().zip(&self.transform_handles) {
			let scale = DVec2::splat(VECTOR_MANIPULATOR_ANCHOR_MARKER_SIZE);
			let translation = (position - (scale / 2.) - 0.5 + BIAS).round();
			let transform = DAffine2::from_scale_angle_translation(scale, 0., translation).to_cols_array();
			let path = path.clone();
			buffer.push(DocumentMessage::Overlays(Operation::SetLayerTransformInViewport { path, transform }.into()).into());
		}
	}
pub fn transform ( & mut self , buffer : & mut Vec < Message > ) { let transform = transform_from_box ( self . bounds [ 0 ] , self . bounds [ 1 ] , self . transform ) . to_cols_array ( ) ; let path = self . bounding_box . clone ( ) ; buffer . push ( DocumentMessage :: Overlays ( Operation :: SetLayerTransformInViewport { path , transform } . into ( ) ) . into ( ) ) ; // Helps push values that end in approximately half, plus or minus some floating point imprecision, towards the same side of the round() function const BIAS : f64 = 0.0001 ; for ( position , path ) in self . evaluate_transform_handle_positions ( ) . into_iter ( ) . zip ( & self . transform_handles ) { let scale = DVec2 :: splat ( VECTOR_MANIPULATOR_ANCHOR_MARKER_SIZE ) ; let translation = ( position - ( scale / 2. ) - 0.5 + BIAS ) . round ( ) ; let transform = DAffine2 :: from_scale_angle_translation ( scale , 0. , translation ) . to_cols_array ( ) ; let path = path . clone ( ) ; buffer . push ( DocumentMessage :: Overlays ( Operation :: SetLayerTransformInViewport { path , transform } . into ( ) ) . into ( ) ) ; } }
Update the position of the bounding box and transform handles
Update the position of the bounding box and transform handles
&mut self
buffer
&mut Vec<Message>
&mut self
buffer
&mut Vec<Message>