fn add_overlay(is_axis: bool, responses: &mut VecDeque<Message>, transform: [f64; 6], opacity: Option<f64>, index: usize, overlay_paths: &mut Vec<Vec<LayerId>>) {
		// If there isn't one in the pool to ruse, add a new alignment line to the pool with the intended transform
		let layer_path = if index >= overlay_paths.len() {
			let layer_path = vec![generate_uuid()];
			responses.push_back(
				DocumentMessage::Overlays(
					if is_axis {
						Operation::AddOverlayLine {
							path: layer_path.clone(),
							transform,
							style: style::PathStyle::new(Some(Stroke::new(COLOR_ACCENT, 1.0)), style::Fill::None),
						}
					} else {
						Operation::AddOverlayEllipse {
							path: layer_path.clone(),
							transform,
							style: style::PathStyle::new(None, style::Fill::Solid(COLOR_ACCENT)),
						}
					}
					.into(),
				)
				.into(),
			);
			overlay_paths.push(layer_path.clone());
			layer_path
		}
		// Otherwise, reuse an overlay from the pool and update its new transform
		else {
			let layer_path = overlay_paths[index].clone();
			responses.push_back(DocumentMessage::Overlays(Operation::SetLayerTransform { path: layer_path.clone(), transform }.into()).into());
			layer_path
		};

		// Then set its opacity to the fade amount
		if let Some(opacity) = opacity {
			responses.push_back(DocumentMessage::Overlays(Operation::SetLayerOpacity { path: layer_path, opacity }.into()).into());
		}
	}
/// Draws an overlay (axis or point) with the correct transform and fade opacity, reusing lines from the pool if available.
Draws an overlay (axis or point) with the correct transform and fade opacity, reusing lines from the pool if available.
Draws an overlay ( axis or point ) with the correct transform and fade opacity reusing lines from the pool if available .
fn add_overlay(is_axis: bool, responses: &mut VecDeque<Message>, transform: [f64; 6], opacity: Option<f64>, index: usize, overlay_paths: &mut Vec<Vec<LayerId>>) {
		// If there isn't one in the pool to ruse, add a new alignment line to the pool with the intended transform
		let layer_path = if index >= overlay_paths.len() {
			let layer_path = vec![generate_uuid()];
			responses.push_back(
				DocumentMessage::Overlays(
					if is_axis {
						Operation::AddOverlayLine {
							path: layer_path.clone(),
							transform,
							style: style::PathStyle::new(Some(Stroke::new(COLOR_ACCENT, 1.0)), style::Fill::None),
						}
					} else {
						Operation::AddOverlayEllipse {
							path: layer_path.clone(),
							transform,
							style: style::PathStyle::new(None, style::Fill::Solid(COLOR_ACCENT)),
						}
					}
					.into(),
				)
				.into(),
			);
			overlay_paths.push(layer_path.clone());
			layer_path
		}
		// Otherwise, reuse an overlay from the pool and update its new transform
		else {
			let layer_path = overlay_paths[index].clone();
			responses.push_back(DocumentMessage::Overlays(Operation::SetLayerTransform { path: layer_path.clone(), transform }.into()).into());
			layer_path
		};
		// Then set its opacity to the fade amount
		if let Some(opacity) = opacity {
			responses.push_back(DocumentMessage::Overlays(Operation::SetLayerOpacity { path: layer_path, opacity }.into()).into());
		}
	}
fn add_overlay ( is_axis : bool , responses : & mut VecDeque < Message > , transform : [ f64 ; 6 ] , opacity : Option < f64 > , index : usize , overlay_paths : & mut Vec < Vec < LayerId > > ) { // If there isn't one in the pool to ruse, add a new alignment line to the pool with the intended transform let layer_path = if index >= overlay_paths . len ( ) { let layer_path = vec ! [ generate_uuid ( ) ] ; responses . push_back ( DocumentMessage :: Overlays ( if is_axis { Operation :: AddOverlayLine { path : layer_path . clone ( ) , transform , style : style :: PathStyle :: new ( Some ( Stroke :: new ( COLOR_ACCENT , 1.0 ) ) , style :: Fill :: None ) , } } else { Operation :: AddOverlayEllipse { path : layer_path . clone ( ) , transform , style : style :: PathStyle :: new ( None , style :: Fill :: Solid ( COLOR_ACCENT ) ) , } } . into ( ) , ) . into ( ) , ) ; overlay_paths . push ( layer_path . clone ( ) ) ; layer_path } // Otherwise, reuse an overlay from the pool and update its new transform else { let layer_path = overlay_paths [ index ] . clone ( ) ; responses . push_back ( DocumentMessage :: Overlays ( Operation :: SetLayerTransform { path : layer_path . clone ( ) , transform } . into ( ) ) . into ( ) ) ; layer_path } ; // Then set its opacity to the fade amount if let Some ( opacity ) = opacity { responses . push_back ( DocumentMessage :: Overlays ( Operation :: SetLayerOpacity { path : layer_path , opacity } . into ( ) ) . into ( ) ) ; } }
Draws an overlay (axis or point) with the correct transform and fade opacity, reusing lines from the pool if available.
Draws an overlay ( axis or point ) with the correct transform and fade opacity reusing lines from the pool if available .
is_axis
bool
responses
&mut VecDeque<Message>
transform
[f64; 6]
opacity
Option<f64>
index
usize
overlay_paths
&mut Vec<Vec<LayerId>>
is_axis
bool
responses
&mut VecDeque<Message>
transform
[f64; 6]
opacity
Option<f64>
index
usize
overlay_paths
&mut Vec<Vec<LayerId>>