Update the color of the drag handles in the drag visual tool immediately when the selection changes

Originally committed to SVN as r6549.
This commit is contained in:
Thomas Goyne 2012-03-09 00:23:04 +00:00
parent d8e0038333
commit 229daa9874
1 changed files with 11 additions and 2 deletions

View File

@ -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)
sel_features.insert(it);
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() {