Skip to content

Commit d84f7c7

Browse files
joarfishKeavon
authored andcommitted
Auto-select new layer created by Pen Tool. (#235)
Signed-off-by: kastenbutt <[email protected]>
1 parent 78b3695 commit d84f7c7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/document/src/document.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ impl Document {
203203
} => {
204204
let points: Vec<glam::DVec2> = points.iter().map(|&it| it.into()).collect();
205205
let polyline = PolyLine::new(points);
206-
self.add_layer(&path, Layer::new(LayerDataTypes::PolyLine(polyline), *transform, *style), *insert_index)?;
207-
Some(vec![DocumentResponse::DocumentChanged])
206+
let id = self.add_layer(&path, Layer::new(LayerDataTypes::PolyLine(polyline), *transform, *style), *insert_index)?;
207+
let path = [path.clone(), vec![id]].concat();
208+
Some(vec![DocumentResponse::DocumentChanged, DocumentResponse::SelectLayer { path }])
208209
}
209210
Operation::AddShape {
210211
path,

0 commit comments

Comments
 (0)