mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
Fix sector offset transformation in Edit Selection mode (PR#274 by mykola-ambar)
This commit is contained in:
parent
6e0acdf789
commit
c6b879bb1a
1 changed files with 7 additions and 6 deletions
|
@ -893,13 +893,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
float texrotation = Angle2D.PI2 - rotation;
|
float texrotation = Angle2D.PI2 - rotation;
|
||||||
|
|
||||||
// Update texture offsets
|
// Update texture offsets
|
||||||
if(transformoffsets)
|
if (transformoffsets)
|
||||||
{
|
{
|
||||||
Vector2D toffset = (selectionbasecenter - selectioncenter).GetRotated((texrotation + si.Rotation));
|
float trotation = rotateoffsets ? (si.Rotation + texrotation) : (si.Rotation);
|
||||||
Vector2D soffset = si.Offset.GetRotated(texrotation + si.Rotation);
|
Vector2D offset = selectioncenter.GetRotated(trotation);
|
||||||
|
|
||||||
|
fields["xpanning" + si.Part] = new UniValue(UniversalType.Float, (float)Math.Round(-offset.x, General.Map.FormatInterface.VertexDecimals));
|
||||||
|
fields["ypanning" + si.Part] = new UniValue(UniversalType.Float, (float)Math.Round(offset.y, General.Map.FormatInterface.VertexDecimals));
|
||||||
|
|
||||||
fields["xpanning" + si.Part] = new UniValue(UniversalType.Float, (float)Math.Round(soffset.x + toffset.x, General.Map.FormatInterface.VertexDecimals) % si.TextureSize.Width);
|
|
||||||
fields["ypanning" + si.Part] = new UniValue(UniversalType.Float, (float)Math.Round(-(soffset.y + toffset.y), General.Map.FormatInterface.VertexDecimals) % si.TextureSize.Height);
|
|
||||||
}
|
}
|
||||||
// Restore texture offsets
|
// Restore texture offsets
|
||||||
else
|
else
|
||||||
|
@ -1825,7 +1826,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
renderer.RenderRectangleFilled(rotategrips[i], General.Colors.Background, true);
|
renderer.RenderRectangleFilled(rotategrips[i], General.Colors.Background, true);
|
||||||
renderer.RenderRectangle(rotategrips[i], 2, General.Colors.Indication, true);
|
renderer.RenderRectangle(rotategrips[i], 2, General.Colors.Indication, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer.Finish();
|
renderer.Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue