Update undoable name when a Stamp becomes a Smear

main
Isaiah Odhner 2019-12-14 16:24:04 -05:00
parent 4e44084ef2
commit c6f3d7b017
2 changed files with 5 additions and 1 deletions

View File

@ -77,7 +77,7 @@ class OnCanvasSelection extends OnCanvasObject {
make_or_update_undoable({
match: (history_node)=> history_node.name.match(/^(Smear|Stamp|Move) Selection$/),
name: e.shiftKey ? "Smear Selection" : "Move Selection",
// TODO: update_name: true?
update_name: true,
icon: get_icon_for_tool(get_tool_by_name("Select")),
soft: true,
}, ()=> {

View File

@ -1100,6 +1100,10 @@ function make_or_update_undoable(undoable_meta, undoable_action) {
current_history_node.selection_image_data = selection && selection.canvas.ctx.getImageData(0, 0, selection.canvas.width, selection.canvas.height);
current_history_node.selection_x = selection && selection.x;
current_history_node.selection_y = selection && selection.y;
if (undoable_meta.update_name) {
current_history_node.name = undoable_meta.name;
}
$G.triggerHandler("history-update"); // update history view
} else {
undoable(undoable_meta, undoable_action);
}