Fixed cache issue on edit undo, and added an edit button for layers
This commit is contained in:
parent
6e13c5742e
commit
dbec3641d8
5 changed files with 14 additions and 8 deletions
|
|
@ -87,6 +87,10 @@ void DrawingProgramLayerManagerGUI::setup_list_gui(const std::string& id, bool&
|
|||
}) {
|
||||
gui.text_label(tempPtr->get_name());
|
||||
}
|
||||
if(gui.svg_icon_button_transparent("edit button", "data/icons/pencil.svg", false, GUIStuff::TreeListing::ENTRY_HEIGHT)) {
|
||||
layerMan.editingLayer = tempPtr;
|
||||
isButtonClicked = true;
|
||||
}
|
||||
if(gui.svg_icon_button_transparent("visible button", tempPtr->get_visible() ? "data/icons/eyeopen.svg" : "data/icons/eyeclose.svg", false, GUIStuff::TreeListing::ENTRY_HEIGHT)) {
|
||||
tempPtr->set_visible(layerMan, !tempPtr->get_visible());
|
||||
isButtonClicked = true;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ void EditTool::switch_tool(DrawingProgramToolType newTool) {
|
|||
return false;
|
||||
auto objPtr = undoMan.world.netObjMan.get_obj_temporary_ref_from_id<CanvasComponentContainer>(toEditID.value());
|
||||
objPtr->get_comp().set_data_from(*oldData);
|
||||
objPtr->commit_update(undoMan.world.drawProg);
|
||||
objPtr->send_comp_update(undoMan.world.drawProg, true);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -83,6 +84,7 @@ void EditTool::switch_tool(DrawingProgramToolType newTool) {
|
|||
return false;
|
||||
auto objPtr = undoMan.world.netObjMan.get_obj_temporary_ref_from_id<CanvasComponentContainer>(toEditID.value());
|
||||
objPtr->get_comp().set_data_from(*newData);
|
||||
objPtr->commit_update(undoMan.world.drawProg);
|
||||
objPtr->send_comp_update(undoMan.world.drawProg, true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue