From 229daa98744047c4773e3effbd438676f17afd82 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 9 Mar 2012 00:23:04 +0000 Subject: [PATCH] Update the color of the drag handles in the drag visual tool immediately when the selection changes Originally committed to SVN as r6549. --- aegisub/src/visual_tool_drag.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/aegisub/src/visual_tool_drag.cpp b/aegisub/src/visual_tool_drag.cpp index 845b0336b..479864ef1 100644 --- a/aegisub/src/visual_tool_drag.cpp +++ b/aegisub/src/visual_tool_drag.cpp @@ -36,6 +36,7 @@ #include "main.h" #include "utils.h" #include "video_context.h" +#include "video_display.h" static const DraggableFeatureType DRAG_ORIGIN = DRAG_BIG_TRIANGLE; static const DraggableFeatureType DRAG_START = DRAG_BIG_SQUARE; @@ -155,12 +156,20 @@ void VisualToolDrag::OnFrameChanged() { void VisualToolDrag::OnSelectedSetChanged(const Selection &added, const Selection &removed) { c->selectionController->GetSelectedSet(selection); + bool any_changed = false; for (feature_iterator it = features.begin(); it != features.end(); ++it) { - if (removed.count(it->line)) + if (removed.count(it->line)) { sel_features.erase(it); - else if (added.count(it->line) && it->type == DRAG_START) + any_changed = true; + } + else if (added.count(it->line) && it->type == DRAG_START) { sel_features.insert(it); + any_changed = true; + } } + + if (any_changed) + parent->Render(); } void VisualToolDrag::Draw() {