diff --git a/aegisub/src/visual_tool.cpp b/aegisub/src/visual_tool.cpp index b121b7914..013df852d 100644 --- a/aegisub/src/visual_tool.cpp +++ b/aegisub/src/visual_tool.cpp @@ -64,6 +64,7 @@ template VisualTool::VisualTool(VideoDisplay *parent, VideoState const& video) : dragStartX(0) , dragStartY(0) +, commitId(-1) , selChanged(false) , selectedFeatures(selFeatures) , grid(VideoContext::Get()->grid) @@ -232,6 +233,11 @@ void VisualTool::OnMouseEvent(wxMouseEvent &event) { if (Update() || needRender) parent->Render(); externalChange = true; + + if (!event.LeftIsDown()) { + // Only coalesce the changes made in a single drag + commitId = -1; + } } template @@ -240,7 +246,7 @@ void VisualTool::Commit(wxString message) { if (message.empty()) { message = _("visual typesetting"); } - grid->ass->Commit(message); + commitId = grid->ass->Commit(message, commitId); grid->CommitChanges(); externalChange = true; diff --git a/aegisub/src/visual_tool.h b/aegisub/src/visual_tool.h index 3de795b72..69a0de685 100644 --- a/aegisub/src/visual_tool.h +++ b/aegisub/src/visual_tool.h @@ -98,6 +98,8 @@ private: int dragStartX; /// Starting x coordinate of the current drag, if any int dragStartY; /// Starting y coordinate of the current drag, if any + int commitId; + /// Set curFeature to the topmost feature under the mouse, or end() if there /// are none void GetHighlightedFeature();