mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Add "Grid" to the Shape tool along with row/column gizmos (#2921)
* integrated grid shape in shape-tool * add overlays,detection,transform for gizmo * fix compile issues * handle negative correctly,fix undo redo and abort * fix missed merge conflicts * fixed mouse cursor,correctly translatiing * cleanup * fix click-target area inside rect and spacing * add 10px closer to gizmo line * resolved conflicts * Code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -60,7 +60,7 @@ impl AsI64 for f64 {
|
||||
#[widget(Radio)]
|
||||
pub enum GridType {
|
||||
#[default]
|
||||
Rectangular,
|
||||
Rectangular = 0,
|
||||
Isometric,
|
||||
}
|
||||
|
||||
@@ -102,6 +102,10 @@ pub fn dvec2_to_point(value: DVec2) -> Point {
|
||||
Point { x: value.x, y: value.y }
|
||||
}
|
||||
|
||||
pub fn get_line_endpoints(line: Line) -> (DVec2, DVec2) {
|
||||
(point_to_dvec2(line.p0), point_to_dvec2(line.p1))
|
||||
}
|
||||
|
||||
pub fn segment_to_handles(segment: &PathSeg) -> BezierHandles {
|
||||
match *segment {
|
||||
PathSeg::Line(_) => BezierHandles::Linear,
|
||||
|
||||
@@ -128,7 +128,10 @@ impl PointDomain {
|
||||
}
|
||||
|
||||
pub fn push(&mut self, id: PointId, position: DVec2) {
|
||||
debug_assert!(!self.id.contains(&id));
|
||||
if self.id.contains(&id) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.id.push(id);
|
||||
self.position.push(position);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user