Make rotation and scale tools set all selected lines rather than just the active one

Originally committed to SVN as r4544.
This commit is contained in:
Thomas Goyne 2010-06-18 07:14:00 +00:00
parent afec51c4ed
commit 961365dfff
3 changed files with 26 additions and 7 deletions

View file

@ -44,6 +44,7 @@
#include "subs_edit_box.h"
#include "subs_grid.h"
#include "utils.h"
#include "video_context.h"
#include "video_display.h"
#include "visual_tool_rotatexy.h"
@ -207,9 +208,14 @@ void VisualToolRotateXY::UpdateHold() {
/// @brief Commit hold
void VisualToolRotateXY::CommitHold() {
AssDialogue* line = GetActiveDialogueLine();
SetOverride(line, L"\\frx",wxString::Format(L"(%0.3g)",curAngleX));
SetOverride(line, L"\\fry",wxString::Format(L"(%0.3g)",curAngleY));
SubtitlesGrid *grid = VideoContext::Get()->grid;
wxArrayInt sel = grid->GetSelection();
for (wxArrayInt::const_iterator cur = sel.begin(); cur != sel.end(); ++cur) {
AssDialogue* line = grid->GetDialogue(*cur);
assert(line);
SetOverride(line, L"\\frx",wxString::Format(L"(%0.3g)",curAngleX));
SetOverride(line, L"\\fry",wxString::Format(L"(%0.3g)",curAngleY));
}
}
/// @brief Get \\org pivot

View file

@ -44,6 +44,7 @@
#include "subs_edit_box.h"
#include "subs_grid.h"
#include "utils.h"
#include "video_context.h"
#include "video_display.h"
#include "visual_tool_rotatez.h"
@ -177,7 +178,13 @@ void VisualToolRotateZ::UpdateHold() {
/// @brief Commit hold
void VisualToolRotateZ::CommitHold() {
SetOverride(GetActiveDialogueLine(), L"\\frz",wxString::Format(L"(%0.3g)",curAngle));
SubtitlesGrid *grid = VideoContext::Get()->grid;
wxArrayInt sel = grid->GetSelection();
for (wxArrayInt::const_iterator cur = sel.begin(); cur != sel.end(); ++cur) {
AssDialogue* line = grid->GetDialogue(*cur);
assert(line);
SetOverride(line, L"\\frz",wxString::Format(L"(%0.3g)",curAngle));
}
}
/// @brief Get \\org pivot

View file

@ -44,6 +44,7 @@
#include "subs_edit_box.h"
#include "subs_grid.h"
#include "utils.h"
#include "video_context.h"
#include "video_display.h"
#include "visual_tool_scale.h"
@ -168,7 +169,12 @@ void VisualToolScale::UpdateHold() {
/// @brief Commit hold
void VisualToolScale::CommitHold() {
SetOverride(GetActiveDialogueLine(), L"\\fscx",wxString::Format(L"(%0.3g)",curScaleX));
SetOverride(GetActiveDialogueLine(), L"\\fscy",wxString::Format(L"(%0.3g)",curScaleY));
SubtitlesGrid *grid = VideoContext::Get()->grid;
wxArrayInt sel = grid->GetSelection();
for (wxArrayInt::const_iterator cur = sel.begin(); cur != sel.end(); ++cur) {
AssDialogue* line = grid->GetDialogue(*cur);
assert(line);
SetOverride(line, L"\\fscx",wxString::Format(L"(%0.3g)",curScaleX));
SetOverride(line, L"\\fscy",wxString::Format(L"(%0.3g)",curScaleY));
}
}