/// <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);
}
}
finally
{
- this.PerformLayout();
+ this.PerformLayout(false);
if (this.LoadProgress != null)
this.LoadProgress(this, new ProgressEventArgs(ProgressState.Complete));
}
private void Document_LineBreakChanged(object sender, EventArgs e)
{
- if (this.Document.LineBreak == LineBreakMethod.PageBound)
- this._LayoutLines.WrapWidth = this.render.TextArea.Width - LineBreakingMarginWidth; //余白を残さないと欠ける
- else if (this.Document.LineBreak == LineBreakMethod.CharUnit)
- this._LayoutLines.WrapWidth = this.render.emSize.Width * this.Document.LineBreakCharCount;
- else
- this._LayoutLines.WrapWidth = LineToIndexTable.NONE_BREAK_LINE;
-
- this._LayoutLines.ClearLayoutCache();
+ this.CalculateLineBreak();
}
protected LineToIndexTable _LayoutLines
set {
this._Padding = value;
CalculateClipRect();
+ CalculateLineBreak();
CalculateLineCountOnScreen();
if (this.Document.RightToLeft)
this._LayoutLines.ClearLayoutCache();
throw new ArgumentOutOfRangeException("");
this._Rect = value;
CalculateClipRect();
+ CalculateLineBreak();
CalculateLineCountOnScreen();
if (this.Document.RightToLeft)
this._LayoutLines.ClearLayoutCache();
GC.SuppressFinalize(this);
}
+ public virtual void CalculateLineBreak()
+ {
+ if (this.Document.LineBreak == LineBreakMethod.PageBound)
+ this._LayoutLines.WrapWidth = this.render.TextArea.Width - LineBreakingMarginWidth; //余白を残さないと欠ける
+ else if (this.Document.LineBreak == LineBreakMethod.CharUnit)
+ this._LayoutLines.WrapWidth = this.render.emSize.Width * this.Document.LineBreakCharCount;
+ else
+ this._LayoutLines.WrapWidth = LineToIndexTable.NONE_BREAK_LINE;
+ }
+
public virtual void CalculateLineCountOnScreen()
{
}