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:
parent
d8e0038333
commit
229daa9874
1 changed files with 11 additions and 2 deletions
|
@ -36,6 +36,7 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
#include "video_display.h"
|
||||||
|
|
||||||
static const DraggableFeatureType DRAG_ORIGIN = DRAG_BIG_TRIANGLE;
|
static const DraggableFeatureType DRAG_ORIGIN = DRAG_BIG_TRIANGLE;
|
||||||
static const DraggableFeatureType DRAG_START = DRAG_BIG_SQUARE;
|
static const DraggableFeatureType DRAG_START = DRAG_BIG_SQUARE;
|
||||||
|
@ -155,12 +156,20 @@ void VisualToolDrag::OnFrameChanged() {
|
||||||
void VisualToolDrag::OnSelectedSetChanged(const Selection &added, const Selection &removed) {
|
void VisualToolDrag::OnSelectedSetChanged(const Selection &added, const Selection &removed) {
|
||||||
c->selectionController->GetSelectedSet(selection);
|
c->selectionController->GetSelectedSet(selection);
|
||||||
|
|
||||||
|
bool any_changed = false;
|
||||||
for (feature_iterator it = features.begin(); it != features.end(); ++it) {
|
for (feature_iterator it = features.begin(); it != features.end(); ++it) {
|
||||||
if (removed.count(it->line))
|
if (removed.count(it->line)) {
|
||||||
sel_features.erase(it);
|
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);
|
sel_features.insert(it);
|
||||||
|
any_changed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (any_changed)
|
||||||
|
parent->Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualToolDrag::Draw() {
|
void VisualToolDrag::Draw() {
|
||||||
|
|
Loading…
Reference in a new issue