Skip to content

Commit 1e61fc7

Browse files
committed
Fix transform of line tool
1 parent ce969b1 commit 1e61fc7

File tree

1 file changed

+5
-2
lines changed
  • editor/src/messages/tool/common_functionality/shapes

1 file changed

+5
-2
lines changed

editor/src/messages/tool/common_functionality/shapes/line_shape.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,16 @@ impl Line {
7070
return;
7171
};
7272

73+
let transform_from_document = document.metadata().transform_to_document(layer).inverse();
74+
let layer_points = document_points.map(|point| transform_from_document.transform_point2(point));
75+
7376
responses.add(NodeGraphMessage::SetInput {
7477
input_connector: InputConnector::node(node_id, 1),
75-
input: NodeInput::value(TaggedValue::DVec2(document_points[0]), false),
78+
input: NodeInput::value(TaggedValue::DVec2(layer_points[0]), false),
7679
});
7780
responses.add(NodeGraphMessage::SetInput {
7881
input_connector: InputConnector::node(node_id, 2),
79-
input: NodeInput::value(TaggedValue::DVec2(document_points[1]), false),
82+
input: NodeInput::value(TaggedValue::DVec2(layer_points[1]), false),
8083
});
8184
responses.add(NodeGraphMessage::RunDocumentGraph);
8285
}

0 commit comments

Comments
 (0)