فهرست منبع

Fix ResetState methods in ContinuousBlock and SolidBlock classes

Marcin Ziąbek 2 ماه پیش
والد
کامیت
c3a7cf9f29

+ 1 - 6
Source/QuestPDF.LayoutTests/TestEngine/ContinuousBlock.cs

@@ -47,12 +47,7 @@ internal class ContinuousBlock : Element, IStateful
         
     private float HeightOffset { get; set; }
 
-    public void ResetState(bool hardReset = false)
-    {
-        if (hardReset)
-            HeightOffset = 0;
-    }
-        
+    public void ResetState(bool hardReset = false) => HeightOffset = 0;
     public object GetState() => HeightOffset;
     public void SetState(object state) => HeightOffset = (float) state;
     

+ 1 - 6
Source/QuestPDF.LayoutTests/TestEngine/SolidBlock.cs

@@ -36,12 +36,7 @@ internal class SolidBlock : Element, IStateful
         
     private bool IsRendered { get; set; }
 
-    public void ResetState(bool hardReset = false)
-    {
-        if (hardReset)
-            IsRendered = false;
-    }
-        
+    public void ResetState(bool hardReset = false) => IsRendered = false;
     public object GetState() => IsRendered;
     public void SetState(object state) => IsRendered = (bool) state;