mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Improve the Shape tool's arrow drawing controls (#3650)
* fixed the arrow's parameters Signed-off-by: krVatsal <kumarvatsal34@gmail.com> * shifted the arrow's origin to its tail Signed-off-by: krVatsal <kumarvatsal34@gmail.com> * modified arrow shapetype fucntion to be like other shapes * fixed rust formatting * Remove misleading part of comment referencing the origin --------- Signed-off-by: krVatsal <kumarvatsal34@gmail.com> Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -330,14 +330,16 @@ impl<PointId: Identifier> Subpath<PointId> {
|
||||
let head_base_distance = (length - head_length).max(0.);
|
||||
let head_base = start + direction * head_base_distance;
|
||||
|
||||
// Arrow path starts at the tail, traces around the shape, and returns to the tail
|
||||
let anchors = [
|
||||
start - perpendicular * half_shaft, // Tail bottom
|
||||
head_base - perpendicular * half_shaft, // Head base bottom (shaft)
|
||||
head_base - perpendicular * half_head, // Head base bottom (wide)
|
||||
end, // Tip
|
||||
head_base + perpendicular * half_head, // Head base top (wide)
|
||||
head_base + perpendicular * half_shaft, // Head base top (shaft)
|
||||
start, // Tail center (origin)
|
||||
start + perpendicular * half_shaft, // Tail top
|
||||
head_base + perpendicular * half_shaft, // Head base top (shaft)
|
||||
head_base + perpendicular * half_head, // Head base top (wide)
|
||||
end, // Tip
|
||||
head_base - perpendicular * half_head, // Head base bottom (wide)
|
||||
head_base - perpendicular * half_shaft, // Head base bottom (shaft)
|
||||
start - perpendicular * half_shaft, // Tail bottom
|
||||
];
|
||||
|
||||
Self::from_anchors(anchors, true)
|
||||
|
||||
Reference in New Issue
Block a user