OSDN Git Service

ウィンドウの幅が変わったら折り返しの幅も再計算するようにした
[fooeditengine/FooEditEngine.git] / Core / Document.cs
index 9c5932f..526bfec 100644 (file)
@@ -754,11 +754,19 @@ namespace FooEditEngine
         /// <summary>
         /// レイアウト行をすべて破棄し、再度レイアウトを行う
         /// </summary>
-        public void PerformLayout()
+        /// <param name="quick">真の場合、レイアウトキャッシュのみ再構築します</param>
+        public void PerformLayout(bool quick = true)
         {
-            this.LayoutLines.IsFrozneDirtyFlag = true;
-            this.FireUpdate(new DocumentUpdateEventArgs(UpdateType.RebuildLayout, -1, -1, -1));
-            this.LayoutLines.IsFrozneDirtyFlag = false;
+            if (quick)
+            {
+                this.LayoutLines.ClearLayoutCache();
+            }
+            else
+            {
+                this.LayoutLines.IsFrozneDirtyFlag = true;
+                this.FireUpdate(new DocumentUpdateEventArgs(UpdateType.RebuildLayout, -1, -1, -1));
+                this.LayoutLines.IsFrozneDirtyFlag = false;
+            }
             if (this.PerformLayouted != null)
                 this.PerformLayouted(this, null);
         }
@@ -1163,7 +1171,7 @@ namespace FooEditEngine
             }
             finally
             {
-                this.PerformLayout();
+                this.PerformLayout(false);
                 if (this.LoadProgress != null)
                     this.LoadProgress(this, new ProgressEventArgs(ProgressState.Complete));
             }