mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-07 15:55:00 +00:00
Fix Path tool multi-point handle scaling behavior and double-click smooth/sharp conversion on rectangles (#2765)
* fixed double-click on anchor connected to linear segments * fix when scaling when anchor * Nit --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
59e34836cd
commit
71ddae9028
3 changed files with 18 additions and 7 deletions
|
@ -11,7 +11,7 @@ use crate::transform::Transform;
|
|||
use crate::vector::click_target::{ClickTargetType, FreePoint};
|
||||
use crate::{AlphaBlending, Color, GraphicGroupTable};
|
||||
pub use attributes::*;
|
||||
use bezier_rs::ManipulatorGroup;
|
||||
use bezier_rs::{BezierHandles, ManipulatorGroup};
|
||||
use core::borrow::Borrow;
|
||||
use core::hash::Hash;
|
||||
use dyn_any::DynAny;
|
||||
|
@ -334,6 +334,13 @@ impl VectorData {
|
|||
index.flat_map(|index| self.segment_domain.connected_points(index).map(|index| self.point_domain.ids()[index]))
|
||||
}
|
||||
|
||||
/// Returns the number of linear segments connected to the given point.
|
||||
pub fn connected_linear_segments(&self, point_id: PointId) -> usize {
|
||||
self.segment_bezier_iter()
|
||||
.filter(|(_, bez, start, end)| ((*start == point_id || *end == point_id) && matches!(bez.handles, BezierHandles::Linear)))
|
||||
.count()
|
||||
}
|
||||
|
||||
/// Get an array slice of all segment IDs.
|
||||
pub fn segment_ids(&self) -> &[SegmentId] {
|
||||
self.segment_domain.ids()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue