mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 21:00:56 +00:00
Visual Mode: fixed a problem that resulted in incorrect texture offsets when moving a texture by grid size, and the grid was a multiple of the texture size
This commit is contained in:
parent
d37e2400bc
commit
b369b944f9
1 changed files with 3 additions and 3 deletions
|
@ -570,17 +570,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// biwa
|
||||
protected static double GetNewTexutreOffset(double oldValue, double offset, double textureSize)
|
||||
{
|
||||
return GetRoundedTextureOffset(oldValue, offset, 1.0f, textureSize);
|
||||
return GetRoundedTextureOffset(oldValue, offset, 1.0, textureSize);
|
||||
}
|
||||
|
||||
//mxd
|
||||
protected static double GetRoundedTextureOffset(double oldValue, double offset, double scale, double textureSize)
|
||||
{
|
||||
if(offset == 0f) return oldValue;
|
||||
if(offset == 0 || offset % textureSize == 0) return oldValue;
|
||||
double scaledOffset = offset * Math.Abs(scale);
|
||||
double result = Math.Round(oldValue + scaledOffset);
|
||||
if(textureSize > 0) result %= textureSize;
|
||||
if(result == oldValue) result += (scaledOffset < 0 ? -1 : 1);
|
||||
if(result == oldValue) result += (scaledOffset < 0 ? -1 : 1); // biwa. Why?
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue