void VisualToolRotateZ::DoRefresh() {
	if (!active_line) return;

	pos = FromScriptCoords(GetLinePosition(active_line));
	if (!(org->pos = GetLineOrigin(active_line)))
		org->pos = pos;
	else
		org->pos = FromScriptCoords(org->pos);

	GetLineRotation(active_line, rotation_x, rotation_y, angle);
	GetLineScale(active_line, scale);
}
示例#2
0
void VisualToolScale::DoRefresh() {
	if (!active_line) return;

	GetLineScale(active_line, scale);
	GetLineRotation(active_line, rx, ry, rz);
	pos = FromScriptCoords(GetLinePosition(active_line));
}
void VisualToolRotateXY::DoRefresh() {
	if (!active_line) return;

	if (!(org->pos = GetLineOrigin(active_line)))
		org->pos = GetLinePosition(active_line);
	org->pos = FromScriptCoords(org->pos);

	GetLineRotation(active_line, angle_x, angle_y, angle_z);
	GetLineShear(active_line, fax, fay);
}
示例#4
0
void VisualToolDrag::MakeFeatures(AssDialogue *diag, feature_iterator pos) {
	Vector2D p1 = FromScriptCoords(GetLinePosition(diag));

	// Create \pos feature
	Feature feat;
	feat.pos = p1;
	feat.layer = 0;
	feat.type = DRAG_START;
	feat.time = 0;
	feat.line = diag;
	feat.parent = features.end();
	features.insert(pos, feat);
	feature_iterator cur = prev(pos);
	feat.parent = cur;
	if (selection.count(diag))
		sel_features.insert(cur);

	Vector2D p2;
	int t1, t2;

	// Create move destination feature
	if (GetLineMove(diag, p1, p2, t1, t2)) {
		feat.pos = FromScriptCoords(p2);
		feat.layer = 1;
		feat.type = DRAG_END;
		feat.parent->time = t1;
		feat.time = t2;
		feat.line = diag;
		features.insert(pos, feat);
		feat.parent->parent = prev(pos);
	}

	// Create org feature
	if (Vector2D org = GetLineOrigin(diag)) {
		feat.pos = FromScriptCoords(org);
		feat.layer = -1;
		feat.type = DRAG_ORIGIN;
		feat.time = 0;
		feat.line = diag;
		features.insert(pos, feat);
	}
}