Browse Source

Fix BresenhamLineOperation mirroring

Equbuxu 2 years ago
parent
commit
174cf00de7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/ChunkyImageLib/Operations/BresenhamLineOperation.cs

+ 3 - 3
src/ChunkyImageLib/Operations/BresenhamLineOperation.cs

@@ -46,8 +46,8 @@ internal class BresenhamLineOperation : IDrawOperation
 
 
     public IDrawOperation AsMirrored(int? verAxisX, int? horAxisY)
     public IDrawOperation AsMirrored(int? verAxisX, int? horAxisY)
     {
     {
-        VecI newFrom = from;
-        VecI newTo = to;
+        RectI newFrom = new RectI(from, new VecI(1));
+        RectI newTo = new RectI(to, new VecI(1));
         if (verAxisX is not null)
         if (verAxisX is not null)
         {
         {
             newFrom = newFrom.ReflectX((int)verAxisX);
             newFrom = newFrom.ReflectX((int)verAxisX);
@@ -58,7 +58,7 @@ internal class BresenhamLineOperation : IDrawOperation
             newFrom = newFrom.ReflectY((int)horAxisY);
             newFrom = newFrom.ReflectY((int)horAxisY);
             newTo = newTo.ReflectY((int)horAxisY);
             newTo = newTo.ReflectY((int)horAxisY);
         }
         }
-        return new BresenhamLineOperation(newFrom, newTo, color, blendMode);
+        return new BresenhamLineOperation(newFrom.Pos, newTo.Pos, color, blendMode);
     }
     }
 
 
     public void Dispose()
     public void Dispose()