Update all selected lines when dragging the origin in the rotate tools

This commit is contained in:
Thomas Goyne 2014-06-29 11:39:51 -07:00
parent 5989226422
commit e1d56f9294
2 changed files with 24 additions and 2 deletions

View file

@ -20,6 +20,9 @@
#include "visual_tool_rotatexy.h"
#include "include/aegisub/context.h"
#include "selection_controller.h"
#include <libaegisub/format.h>
#include <cmath>
@ -168,7 +171,15 @@ void VisualToolRotateXY::UpdateHold() {
}
void VisualToolRotateXY::UpdateDrag(Feature *feature) {
SetOverride(active_line, "\\org", ToScriptCoords(feature->pos).PStr());
auto org = GetLineOrigin(active_line);
if (!org) org = GetLinePosition(active_line);
auto d = ToScriptCoords(feature->pos) - org;
for (auto line : c->selectionController->GetSelectedSet()) {
org = GetLineOrigin(line);
if (!org) org = GetLinePosition(line);
SetOverride(line, "\\org", (d + org).PStr());
}
}
void VisualToolRotateXY::DoRefresh() {

View file

@ -20,6 +20,9 @@
#include "visual_tool_rotatez.h"
#include "include/aegisub/context.h"
#include "selection_controller.h"
#include <libaegisub/format.h>
#include <cmath>
@ -113,7 +116,15 @@ void VisualToolRotateZ::UpdateHold() {
}
void VisualToolRotateZ::UpdateDrag(Feature *feature) {
SetOverride(active_line, "\\org", ToScriptCoords(feature->pos).PStr());
auto org = GetLineOrigin(active_line);
if (!org) org = GetLinePosition(active_line);
auto d = ToScriptCoords(feature->pos) - org;
for (auto line : c->selectionController->GetSelectedSet()) {
org = GetLineOrigin(line);
if (!org) org = GetLinePosition(line);
SetOverride(line, "\\org", (d + org).PStr());
}
}
void VisualToolRotateZ::DoRefresh() {