Skip to content

Commit

Permalink
fix a bug while deleting graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
ffiirree committed May 24, 2023
1 parent fd41b35 commit 5f4964f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ add_subdirectory(3rdparty/fmt EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/probe EXCLUDE_FROM_ALL)

# Windows SDK >= 10.0.22621.0
if (WIN32 AND ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} VERSION_LESS "10.0.22621.0")
if (WIN32 AND "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" VERSION_LESS "10.0.22621.0")
message(FATAL_ERROR "Capturer requires Windows SDK 10.0.22621.0 and above to compile.")
endif()

Expand Down
16 changes: 12 additions & 4 deletions src/core/canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,18 @@ void Canvas::paste()
void Canvas::remove()
{
if (enabled_ && focus_cmd_) {
HIDE_AND_COPY_CMD(focus_cmd_);
commands_.push(focus_cmd_);
redo_stack_.clear();
focusOn(nullptr);
// focus is not pseudo, then create one
if (!focus_cmd_->previous()) {
HIDE_AND_COPY_CMD(focus_cmd_);
}

focus_cmd_->visible(false);

// not editing (not goto mouse release event handler)
if (!(edit_status_ & OPERATION_MASK)) {
commands_.push(focus_cmd_);
redo_stack_.clear();
}
}
}

Expand Down

0 comments on commit 5f4964f

Please sign in to comment.