mirror of https://github.com/odrling/Aegisub
Update all selected lines when dragging the origin in the rotate tools
This commit is contained in:
parent
5989226422
commit
e1d56f9294
|
@ -20,6 +20,9 @@
|
||||||
|
|
||||||
#include "visual_tool_rotatexy.h"
|
#include "visual_tool_rotatexy.h"
|
||||||
|
|
||||||
|
#include "include/aegisub/context.h"
|
||||||
|
#include "selection_controller.h"
|
||||||
|
|
||||||
#include <libaegisub/format.h>
|
#include <libaegisub/format.h>
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
@ -168,7 +171,15 @@ void VisualToolRotateXY::UpdateHold() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualToolRotateXY::UpdateDrag(Feature *feature) {
|
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() {
|
void VisualToolRotateXY::DoRefresh() {
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
|
|
||||||
#include "visual_tool_rotatez.h"
|
#include "visual_tool_rotatez.h"
|
||||||
|
|
||||||
|
#include "include/aegisub/context.h"
|
||||||
|
#include "selection_controller.h"
|
||||||
|
|
||||||
#include <libaegisub/format.h>
|
#include <libaegisub/format.h>
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
@ -113,7 +116,15 @@ void VisualToolRotateZ::UpdateHold() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualToolRotateZ::UpdateDrag(Feature *feature) {
|
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() {
|
void VisualToolRotateZ::DoRefresh() {
|
||||||
|
|
Loading…
Reference in New Issue