From ef88a1be9ab1615374882f06f2fe43211531db54 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 19 Oct 2021 23:49:39 -0400 Subject: [PATCH] handle selection undo/redo rotations better --- src/kiri/do.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/kiri/do.js b/src/kiri/do.js index 047f87b0..a7919324 100644 --- a/src/kiri/do.js +++ b/src/kiri/do.js @@ -92,21 +92,22 @@ kiri.load(function(API) { }); // selection event (store position) - event.on('widget.rotate', (rec) => { + event.on('selection.rotate', (rec) => { let type = "rotate"; - let {widget, x, y, z} = rec; + let widgets = API.selection.widgets(true); + let {x, y, z} = rec; if (!(x || y || z)) { return; } pushActions({ redo: { type, - widgets: [ widget ], + widgets, x, y, z }, undo: { type, - widgets: [ widget ], + widgets, x: -x, y: -y, z: -z } })