GraphiteEditor / GraphiteEditor/Graphite

Auto-Tangents node with spread = 0 and preserve existing = true causes weird change

Đang mở
#3,822 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
27.3k
Fork
1.3k
Merge trung bình
20 giờ 5 phút
Pull request đã merge (30 ngày)
57

Mô tả

When spread = 0 and preserve existing = true, we would expect the node to have no effect. But instead, it makes a weird slight change to the geometry based on doing something to the handles as we see here, which goes away when spread becomes slightly larger than 0:

https://github.com/user-attachments/assets/1a418c65-20c5-4e1a-b01e-43a5ad68a1d6

Paste this into a document:
```
graphite/layer: [{"nodes":[[3,{"document_node":{"inputs":[{"Node":{"node_id":4,"output_index":0}},{"Value":{"tagged_value":{"Color":{"element":[{"red":0.0,"green":0.0,"blue":0.0,"alpha":1.0}],"transform":[[1.0,0.0,0.0,1.0,0.0,0.0]],"alpha_blending":[{"blend_mode":"Normal","opacity":1.0,"fill":1.0,"clip":false}],"source_node_id":[null]}},"exposed":false}},{"Value":{"tagged_value":{"F64":2.0},"exposed":false}},{"Value":{"tagged_value":{"StrokeAlign":"Center"},"exposed":false}},{"Value":{"tagged_value":{"StrokeCap":"Butt"},"exposed":false}},{"Value":{"tagged_value":{"StrokeJoin":"Miter"},"exposed":false}},{"Value":{"tagged_value":{"F64":4.0},"exposed":false}},{"Value":{"tagged_value":{"PaintOrder":"StrokeAbove"},"exposed":false}},{"Value":{"tagged_value":{"VecF64":[]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"ProtoNode":{"name":"graphene_core::vector::StrokeNode"}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}},"persistent_node_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Content","input_description":"The content with vector paths to apply the stroke style to.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Color","input_description":"The stroke color.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Weight","input_description":"The stroke thickness.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Align","input_description":"The alignment of stroke to the path's centerline or (for closed shapes) the inside or outside of the shape.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Cap","input_description":"The shape of the stroke at open endpoints.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Join","input_description":"The curvature of the bent stroke at sharp corners.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Miter Limit","input_description":"The threshold for when a miter-joined stroke is converted to a bevel-joined stroke when a sharp angle becomes pointier than this ratio.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Paint Order","input_description":"The order to paint the stroke on top of the fill, or the fill on top of the stroke.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Dash Lengths","input_description":"The stroke dash lengths. Each length forms a distance in a pattern where the first length is a dash, the second is a gap, and so on. If the list is an odd length, the pattern repeats with solid-gap roles reversed.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Dash Offset","input_description":"The phase offset distance from the starting point of the dash pattern.\n"}}],"output_names":[],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":"Chain"}},"network_metadata":null}}],[0,{"document_node":{"inputs":[{"Value":{"tagged_value":{"Graphic":{"element":[],"transform":[],"alpha_blending":[],"source_node_id":[]}},"exposed":true}},{"Node":{"node_id":1,"output_index":0}}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"Network":{"exports":[{"Node":{"node_id":4,"output_index":0}}],"nodes":[[0,{"inputs":[{"Import":{"import_type":{"Generic":"T"},"import_index":0}}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"ProtoNode":{"name":"graphic_nodes::graphic::ToGraphicNode"}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}}],[4,{"inputs":[{"Node":{"node_id":0,"output_index":0}},{"Node":{"node_id":3,"output_index":0}}],"call_argument":{"Generic":"T"},"implementation":{"ProtoNode":{"name":"graphic_nodes::graphic::ExtendNode"}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}}],[3,{"inputs":[{"Node":{"node_id":2,"output_index":0}}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode"}},"visible":true,"skip_deduplication":true,"context_features":{"extract":"","inject":""}}],[2,{"inputs":[{"Node":{"node_id":1,"output_index":0}},{"Reflection":"DocumentNodePath"}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"ProtoNode":{"name":"graphic_nodes::graphic::SourceNodeIdNode"}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}}],[1,{"inputs":[{"Import":{"import_type":{"Generic":"T"},"import_index":1}}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"ProtoNode":{"name":"graphic_nodes::graphic::WrapGraphicNode"}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}}]],"scope_injections":[]}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}},"persistent_node_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Base","input_description":"TODO"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Content","input_description":"TODO"}}],"output_names":["Out"],"locked":false,"pinned":false,"node_type_metadata":{"Layer":{"position":{"Absolute":[-6,5]}}},"network_metadata":{"persistent_metadata":{"reference":"Merge","node_metadata":[[4,{"persistent_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Base","input_description":"The table whose rows will appear at the start of the extended table.\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"New","input_description":"The table whose rows will appear at the end of the extended table.\n"}}],"output_names":[],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[0,-3]}}},"network_metadata":null}}],[1,{"persistent_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Content","input_description":""}}],"output_names":[],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[-21,-1]}}},"network_metadata":null}}],[3,{"persistent_metadata":{"display_name":"Monitor","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"In","input_description":"TODO"}}],"output_names":["Out"],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[-7,-1]}}},"network_metadata":null}}],[0,{"persistent_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Content","input_description":""}}],"output_names":[],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[-21,-3]}}},"network_metadata":null}}],[2,{"persistent_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Content","input_description":""}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Node Path","input_description":""}}],"output_names":[],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[-14,-1]}}},"network_metadata":null}}]],"previewing":"No","navigation_metadata":{"node_graph_ptz":{"pan":[0.0,0.0],"tilt":0.0,"zoom":1.0,"flip":false},"node_graph_to_viewport":[1.0,0.0,0.0,1.0,0.0,0.0],"node_graph_width":0.0},"selection_undo_history":[],"selection_redo_history":[]}}}}],[1,{"document_node":{"inputs":[{"Node":{"node_id":2,"output_index":0}},{"Value":{"tagged_value":{"VectorModification":{"points":{"add":[],"remove":[],"delta":[]},"segments":{"add":[],"remove":[],"start_point":[],"end_point":[],"handle_primary":[],"handle_end":[],"stroke":[]},"regions":{"add":[],"remove":[],"segment_range":[],"fill":[]},"add_g1_continuous":[],"remove_g1_continuous":[]}},"exposed":false}}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"Network":{"exports":[{"Node":{"node_id":1,"output_index":0}}],"nodes":[[0,{"inputs":[{"Import":{"import_type":{"Concrete":{"name":"core_types::table::Table>>>","alias":null}},"import_index":0}}],"call_argument":{"Generic":"T"},"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode"}},"visible":true,"skip_deduplication":true,"context_features":{"extract":"","inject":""}}],[1,{"inputs":[{"Node":{"node_id":0,"output_index":0}},{"Import":{"import_type":{"Concrete":{"name":"vector_types::vector::vector_modification::VectorModification","alias":null}},"import_index":1}},{"Reflection":"DocumentNodePath"}],"call_argument":{"Generic":"T"},"implementation":{"ProtoNode":{"name":"vector_nodes::vector_modification_nodes::PathModifyNode"}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}}]],"scope_injections":[]}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}},"persistent_node_metadata":{"display_name":"Path","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Content","input_description":"TODO"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Modification","input_description":"TODO"}}],"output_names":["Modified"],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":"Chain"}},"network_metadata":{"persistent_metadata":{"reference":"Path","node_metadata":[[0,{"persistent_metadata":{"display_name":"Monitor","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"In","input_description":"TODO"}}],"output_names":["Out"],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[0,0]}}},"network_metadata":null}}],[1,{"persistent_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Vector","input_description":""}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Modification","input_description":""}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Node Path","input_description":""}}],"output_names":[],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[7,0]}}},"network_metadata":null}}]],"previewing":"No","navigation_metadata":{"node_graph_ptz":{"pan":[0.0,0.0],"tilt":0.0,"zoom":1.0,"flip":false},"node_graph_to_viewport":[1.0,0.0,0.0,1.0,0.0,0.0],"node_graph_width":0.0},"selection_undo_history":[],"selection_redo_history":[]}}}}],[2,{"document_node":{"inputs":[{"Node":{"node_id":3,"output_index":0}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"Bool":true},"exposed":false}}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"ProtoNode":{"name":"core_types::vector::AutoTangentsNode"}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}},"persistent_node_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Source","input_description":""}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Spread","input_description":"The amount of spread for the auto-tangents, from 0 (sharp corner) to 1 (full spread).\n"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Preserve Existing","input_description":"If active, existing non-zero handles won't be affected.\n"}}],"output_names":[],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":"Chain"}},"network_metadata":null}}],[4,{"document_node":{"inputs":[{"Value":{"tagged_value":{"Vector":{"element":[],"transform":[],"alpha_blending":[],"source_node_id":[]}},"exposed":true}},{"Value":{"tagged_value":{"VectorModification":{"points":{"add":[2824927086324574003,12267384971112396076,6920513407301759964,7662815152551425541,18019509006563527319,11019549282117582496,5871351957759230107,9983200790928033606,14625664048692784402,13109328007591605320,3746561433882380488,14297238665313298103,11571076618816779188],"remove":[],"delta":[[3746561433882380488,[1253.0,693.0]],[11571076618816779188,[1093.0,624.0]],[5871351957759230107,[1338.0,893.0]],[9983200790928033606,[981.0,823.0]],[11019549282117582496,[1460.6705079805595,955.4365807712521]],[13109328007591605320,[1289.0,834.0]],[6920513407301759964,[1344.0,689.0]],[2824927086324574003,[981.0,516.0]],[14625664048692784402,[1122.0,801.1191844816765]],[14297238665313298103,[1041.0,716.0]],[7662815152551425541,[1448.0,443.0]],[18019509006563527319,[1562.0,789.0]],[12267384971112396076,[1214.0,355.0]]]},"segments":{"add":[1071063980543553266,11514393265320307496,13812305791755880086,10201421578253736354,6044340111898985005,2588588753941268433,9133174215081297491,10522574924822421123,2110195024974823375,10600227524568239621,3480392499382967784,162924543543073057,15164108566649924014],"remove":[],"start_point":[[13812305791755880086,6920513407301759964],[10522574924822421123,9983200790928033606],[15164108566649924014,11571076618816779188],[162924543543073057,14297238665313298103],[10201421578253736354,7662815152551425541],[11514393265320307496,12267384971112396076],[6044340111898985005,18019509006563527319],[10600227524568239621,13109328007591605320],[1071063980543553266,2824927086324574003],[3480392499382967784,3746561433882380488],[9133174215081297491,5871351957759230107],[2110195024974823375,14625664048692784402],[2588588753941268433,11019549282117582496]],"end_point":[[11514393265320307496,6920513407301759964],[13812305791755880086,7662815152551425541],[9133174215081297491,9983200790928033606],[10201421578253736354,18019509006563527319],[2110195024974823375,13109328007591605320],[3480392499382967784,14297238665313298103],[1071063980543553266,12267384971112396076],[10522574924822421123,14625664048692784402],[10600227524568239621,3746561433882380488],[162924543543073057,11571076618816779188],[6044340111898985005,11019549282117582496],[15164108566649924014,2824927086324574003],[2588588753941268433,5871351957759230107]],"handle_primary":[[10522574924822421123,[0.0,0.0]],[11514393265320307496,[-4.0,185.0]],[1071063980543553266,[228.0,-215.0]],[2588588753941268433,[12.0,-138.0]],[2110195024974823375,[0.0,0.0]],[13812305791755880086,[0.0,0.0]],[162924543543073057,[0.0,0.0]],[9133174215081297491,[-167.0,112.0]],[3480392499382967784,[0.0,0.0]],[15164108566649924014,[0.0,0.0]],[6044340111898985005,[0.0,0.0]],[10201421578253736354,[0.0,0.0]],[10600227524568239621,[0.0,0.0]]],"handle_end":[[10600227524568239621,[0.0,0.0]],[2588588753941268433,[167.0,-112.0]],[13812305791755880086,[0.0,0.0]],[9133174215081297491,[0.0,0.0]],[11514393265320307496,[0.0,0.0]],[10522574924822421123,[0.0,0.0]],[15164108566649924014,[-21.0,70.0]],[162924543543073057,[0.0,0.0]],[2110195024974823375,[0.0,0.0]],[3480392499382967784,[0.0,0.0]],[10201421578253736354,[0.0,0.0]],[1071063980543553266,[4.0,-185.0]],[6044340111898985005,[-12.0,138.0]]],"stroke":[[13812305791755880086,0],[10522574924822421123,0],[2588588753941268433,0],[15164108566649924014,0],[162924543543073057,0],[10600227524568239621,0],[2110195024974823375,0],[9133174215081297491,0],[1071063980543553266,0],[10201421578253736354,0],[3480392499382967784,0],[11514393265320307496,0],[6044340111898985005,0]]},"regions":{"add":[],"remove":[],"segment_range":[],"fill":[]},"add_g1_continuous":[[{"ty":"End","segment":1071063980543553266},{"ty":"Primary","segment":11514393265320307496}],[{"ty":"End","segment":6044340111898985005},{"ty":"Primary","segment":2588588753941268433}],[{"ty":"End","segment":2588588753941268433},{"ty":"Primary","segment":9133174215081297491}]],"remove_g1_continuous":[[{"ty":"End","segment":11514393265320307496},{"ty":"Primary","segment":13812305791755880086}],[{"ty":"End","segment":2110195024974823375},{"ty":"Primary","segment":10600227524568239621}],[{"ty":"End","segment":3480392499382967784},{"ty":"Primary","segment":162924543543073057}],[{"ty":"End","segment":9133174215081297491},{"ty":"Primary","segment":10522574924822421123}],[{"ty":"End","segment":10522574924822421123},{"ty":"Primary","segment":2110195024974823375}],[{"ty":"End","segment":15164108566649924014},{"ty":"Primary","segment":1071063980543553266}],[{"ty":"End","segment":10600227524568239621},{"ty":"Primary","segment":3480392499382967784}],[{"ty":"End","segment":13812305791755880086},{"ty":"Primary","segment":10201421578253736354}],[{"ty":"End","segment":10201421578253736354},{"ty":"Primary","segment":6044340111898985005}]]}},"exposed":false}}],"call_argument":{"Concrete":{"name":"core::option::Option>","alias":null}},"implementation":{"Network":{"exports":[{"Node":{"node_id":1,"output_index":0}}],"nodes":[[0,{"inputs":[{"Import":{"import_type":{"Concrete":{"name":"core_types::table::Table>>>","alias":null}},"import_index":0}}],"call_argument":{"Generic":"T"},"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode"}},"visible":true,"skip_deduplication":true,"context_features":{"extract":"","inject":""}}],[1,{"inputs":[{"Node":{"node_id":0,"output_index":0}},{"Import":{"import_type":{"Concrete":{"name":"vector_types::vector::vector_modification::VectorModification","alias":null}},"import_index":1}},{"Reflection":"DocumentNodePath"}],"call_argument":{"Generic":"T"},"implementation":{"ProtoNode":{"name":"vector_nodes::vector_modification_nodes::PathModifyNode"}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}}]],"scope_injections":[]}},"visible":true,"skip_deduplication":false,"context_features":{"extract":"","inject":""}},"persistent_node_metadata":{"display_name":"Path","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Content","input_description":"TODO"}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Modification","input_description":"TODO"}}],"output_names":["Modified"],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":"Chain"}},"network_metadata":{"persistent_metadata":{"reference":"Path","node_metadata":[[0,{"persistent_metadata":{"display_name":"Monitor","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"In","input_description":"TODO"}}],"output_names":["Out"],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[0,0]}}},"network_metadata":null}}],[1,{"persistent_metadata":{"display_name":"","input_metadata":[{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Vector","input_description":""}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Modification","input_description":""}},{"persistent_metadata":{"input_data":{},"widget_override":null,"input_name":"Node Path","input_description":""}}],"output_names":[],"locked":false,"pinned":false,"node_type_metadata":{"Node":{"position":{"Absolute":[7,0]}}},"network_metadata":null}}]],"previewing":"No","navigation_metadata":{"node_graph_ptz":{"pan":[0.0,0.0],"tilt":0.0,"zoom":1.0,"flip":false},"node_graph_to_viewport":[1.0,0.0,0.0,1.0,0.0,0.0],"node_graph_width":0.0},"selection_undo_history":[],"selection_redo_history":[]}}}}]],"selected":true,"visible":true,"locked":false,"collapsed":false}]
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Tái hiện vấn đề bằng tài liệu đã được tuần tự hóa trong báo cáo, với nút Auto-Tangents được đặt thành spread = 0 và preserve existing = true. So sánh hình học với cùng tài liệu nhưng có spread lớn hơn một chút, sau đó tìm phần triển khai Auto-Tangents và các bài kiểm thử hiện có. Hoàn tất khi spread = 0 giữ nguyên hình học.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
computer-graphics
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.