mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 20:28:13 +08:00
Promote vector meshes from experimental by removing it from preferences
This commit is contained in:
@@ -421,7 +421,7 @@ impl ShapeState {
|
||||
(point.as_handle().is_some() && self.ignore_handles) || (point.as_anchor().is_some() && self.ignore_anchors)
|
||||
}
|
||||
|
||||
pub fn close_selected_path(&self, document: &DocumentMessageHandler, responses: &mut VecDeque<Message>, vector_meshes: bool) {
|
||||
pub fn close_selected_path(&self, document: &DocumentMessageHandler, responses: &mut VecDeque<Message>) {
|
||||
// First collect all selected anchor points across all layers
|
||||
let all_selected_points: Vec<(LayerNodeIdentifier, PointId)> = self
|
||||
.selected_shape_state
|
||||
@@ -446,14 +446,6 @@ impl ShapeState {
|
||||
let (layer1, start_point) = all_selected_points[0];
|
||||
let (layer2, end_point) = all_selected_points[1];
|
||||
|
||||
let Some(vector1) = document.network_interface.compute_modified_vector(layer1) else { return };
|
||||
let Some(vector2) = document.network_interface.compute_modified_vector(layer2) else { return };
|
||||
|
||||
// If vector meshes is not selected then only for endpoints, otherwise normally applicable
|
||||
if !vector_meshes && (vector1.all_connected(start_point).count() != 1 || vector2.all_connected(end_point).count() != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if layer1 == layer2 {
|
||||
if start_point == end_point {
|
||||
return;
|
||||
|
||||
@@ -22,14 +22,8 @@ use graphene_std::vector::{HandleExt, PointId, SegmentId, Vector, VectorModifica
|
||||
use kurbo::{CubicBez, DEFAULT_ACCURACY, Line, ParamCurve, PathSeg, Point, QuadBez, Shape};
|
||||
|
||||
/// Determines if a path should be extended. Goal in viewport space. Returns the path and if it is extending from the start, if applicable.
|
||||
pub fn should_extend(
|
||||
document: &DocumentMessageHandler,
|
||||
goal: DVec2,
|
||||
tolerance: f64,
|
||||
layers: impl Iterator<Item = LayerNodeIdentifier>,
|
||||
preferences: &PreferencesMessageHandler,
|
||||
) -> Option<(LayerNodeIdentifier, PointId, DVec2)> {
|
||||
closest_point(document, goal, tolerance, layers, |_| false, preferences)
|
||||
pub fn should_extend(document: &DocumentMessageHandler, goal: DVec2, tolerance: f64, layers: impl Iterator<Item = LayerNodeIdentifier>) -> Option<(LayerNodeIdentifier, PointId, DVec2)> {
|
||||
closest_point(document, goal, tolerance, layers, |_| false)
|
||||
}
|
||||
|
||||
/// Determine the closest point to the goal point under max_distance.
|
||||
@@ -40,7 +34,6 @@ pub fn closest_point<T>(
|
||||
max_distance: f64,
|
||||
layers: impl Iterator<Item = LayerNodeIdentifier>,
|
||||
exclude: T,
|
||||
preferences: &PreferencesMessageHandler,
|
||||
) -> Option<(LayerNodeIdentifier, PointId, DVec2)>
|
||||
where
|
||||
T: Fn(PointId) -> bool,
|
||||
@@ -50,7 +43,7 @@ where
|
||||
for layer in layers {
|
||||
let viewspace = document.metadata().transform_to_viewport(layer);
|
||||
let Some(vector) = document.network_interface.compute_modified_vector(layer) else { continue };
|
||||
for id in vector.extendable_points(preferences.vector_meshes) {
|
||||
for id in vector.extendable_points() {
|
||||
if exclude(id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user