Update all selected rows in the rectangular clip tool rather than just the active line

This commit is contained in:
Thomas Goyne 2012-10-20 07:56:38 -07:00
parent 6b3cfcebfd
commit b74130579f

View file

@ -28,6 +28,9 @@
#include "visual_tool_clip.h" #include "visual_tool_clip.h"
#include "ass_dialogue.h"
#include "include/aegisub/context.h"
#include "selection_controller.h"
#include "utils.h" #include "utils.h"
VisualToolClip::VisualToolClip(VideoDisplay *parent, agi::Context *context) VisualToolClip::VisualToolClip(VideoDisplay *parent, agi::Context *context)
@ -113,8 +116,15 @@ void VisualToolClip::UpdateHold() {
} }
void VisualToolClip::CommitHold() { void VisualToolClip::CommitHold() {
SetOverride(active_line, inverse ? "\\iclip" : "\\clip", wxString value = wxString::Format("(%s,%s)", ToScriptCoords(cur_1.Min(cur_2)).Str(), ToScriptCoords(cur_1.Max(cur_2)).Str());
wxString::Format("(%s,%s)", ToScriptCoords(cur_1.Min(cur_2)).Str(), ToScriptCoords(cur_1.Max(cur_2)).Str()));
SubtitleSelection sel = c->selectionController->GetSelectedSet();
for (SubtitleSelection::iterator it = sel.begin(); it != sel.end(); ++it) {
// This check is technically not correct as it could be outside of an
// override block... but that's rather unlikely
bool has_iclip = (*it)->Text.find("\\iclip") != wxString::npos;
SetOverride(*it, has_iclip ? "\\iclip" : "\\clip", value);
}
} }
bool VisualToolClip::InitializeDrag(feature_iterator) { bool VisualToolClip::InitializeDrag(feature_iterator) {