breakConditionBefore = DW.BreakCondition.CanBreak;
}
+ DW.InlineObjectMetrics? _Metrics;
public DW.InlineObjectMetrics Metrics
{
get
{
- DW.InlineObjectMetrics value = new DW.InlineObjectMetrics();
- value.Height = this.Layout.Metrics.Height;
- value.Width = this.Layout.Metrics.Width;
- DW.LineMetrics[] lines = this.Layout.GetLineMetrics();
- value.Baseline = lines[0].Baseline;
- return value;
+ if(_Metrics == null)
+ {
+ DW.InlineObjectMetrics value = new DW.InlineObjectMetrics();
+ value.Height = this.Layout.Metrics.Height;
+ value.Width = this.Layout.Metrics.Width;
+ DW.LineMetrics[] lines = this.Layout.GetLineMetrics();
+ value.Baseline = lines[0].Baseline;
+ _Metrics = value;
+ }
+ return _Metrics.Value;
}
}
+ public DW.OverhangMetrics? _OverhangMetrics;
public DW.OverhangMetrics OverhangMetrics
{
get
{
- DW.OverhangMetrics value = new DW.OverhangMetrics();
- DW.TextMetrics metrics = this.Layout.Metrics;
- value.Left = metrics.Left;
- value.Right = metrics.Left + metrics.Width;
- value.Top = metrics.Top;
- value.Bottom = metrics.Top + metrics.Height;
- return value;
+ if(_OverhangMetrics == null)
+ {
+ DW.OverhangMetrics value = new DW.OverhangMetrics();
+ DW.TextMetrics metrics = this.Layout.Metrics;
+ value.Left = metrics.Left;
+ value.Right = metrics.Left + metrics.Width;
+ value.Top = metrics.Top;
+ value.Bottom = metrics.Top + metrics.Height;
+ _OverhangMetrics = value;
+ }
+ return _OverhangMetrics.Value;
}
}
this.Brush = brush;
}
+ DW.InlineObjectMetrics? _Metrics;
public DW.InlineObjectMetrics Metrics
{
get
{
- DW.InlineObjectMetrics value = new DW.InlineObjectMetrics();
- value.Width = (float)this._TabWidth;
- value.Height = (float)LineHeight;
- value.Baseline = (float)(value.Height * 0.8); //デフォルトでは8割らしい
- value.SupportsSideways = false;
- return value;
+ if(_Metrics == null)
+ {
+ DW.InlineObjectMetrics value = new DW.InlineObjectMetrics();
+ value.Width = (float)this._TabWidth;
+ value.Height = (float)LineHeight;
+ value.Baseline = (float)(value.Height * 0.8); //デフォルトでは8割らしい
+ value.SupportsSideways = false;
+ _Metrics = value;
+ }
+ return _Metrics.Value;
}
}
+ public DW.OverhangMetrics? _OverhangMetrics;
public DW.OverhangMetrics OverhangMetrics
{
get
{
- DW.OverhangMetrics value = new DW.OverhangMetrics();
- DW.InlineObjectMetrics metrics = this.Metrics;
- value.Left = 0;
- value.Right = metrics.Width;
- value.Top = 0;
- value.Bottom = metrics.Height;
- return value;
+ if (_OverhangMetrics == null)
+ {
+ DW.OverhangMetrics value = new DW.OverhangMetrics();
+ DW.InlineObjectMetrics metrics = this.Metrics;
+ value.Left = 0;
+ value.Right = metrics.Width;
+ value.Top = 0;
+ value.Bottom = metrics.Height;
+ _OverhangMetrics = value;
+ }
+ return _OverhangMetrics.Value;
}
}
DrawUpdateArea(i, pos.Y);
- pos.Y += this.LayoutLines.GetLayout(i).Height;
+ pos.Y += layout.Height;
//pos.Y += this.render.emSize.Height;
}
this.render.DrawOneLine(this.Document, this.LayoutLines, i, pos.X, pos.Y);
- pos.Y += this.LayoutLines.GetLayout(i).Height;
+ pos.Y += layout.Height;
//pos.Y += this.render.emSize.Height;
}
IEditorRender render = (IEditorRender)base.render;
int row = this.Document.CaretPostion.row;
- double lineHeight = this.LayoutLines.GetLayout(row).Height;
- double charWidth = this.LayoutLines.GetLayout(row).GetWidthFromIndex(this.Document.CaretPostion.col);
+ ITextLayout layout = this.LayoutLines.GetLayout(row);
+ double lineHeight = layout.Height;
+ double charWidth = layout.GetWidthFromIndex(this.Document.CaretPostion.col);
if (this.InsertMode || charWidth == 0)
{