X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Core%2FEditView.cs;h=ee5252634f3e00a3815ab01da9e0dddccc65d8c1;hb=450b22e9241eea1a294b4eb819114baa89cd67a8;hp=14423b0101af2145c3162537d40339f1cd1301c5;hpb=b8781bb7d15031261c47cd559c703c9a865756cb;p=fooeditengine%2FFooEditEngine.git
diff --git a/Core/EditView.cs b/Core/EditView.cs
index 14423b0..ee52526 100644
--- a/Core/EditView.cs
+++ b/Core/EditView.cs
@@ -21,6 +21,12 @@ namespace FooEditEngine
Both,
}
+ enum TextPointSearchRange
+ {
+ TextAreaOnly,
+ Full
+ }
+
///
/// ãã£ã¬ããã¨ããã¥ã¡ã³ãã®è¡¨ç¤ºãæ
å½ãã¾ããã¬ã¤ã¢ã¦ãé¢é£ããã¡ãã§è¡ãã¾ã
///
@@ -29,7 +35,7 @@ namespace FooEditEngine
{
internal const float LineMarkerThickness = 2;
long tickCount;
- bool _CaretBlink, _HideRuler = true;
+ bool _CaretBlink;
internal const int LineNumberLength = 6;
const int UpdateAreaPaddingWidth = 2;
const int UpdateAreaWidth = 4;
@@ -179,6 +185,22 @@ namespace FooEditEngine
return false;
}
+ public bool IsUpperTextArea(double x, double y)
+ {
+ if (x >= this.render.TextArea.X && x <= this.render.TextArea.Right && y < this.render.TextArea.Y)
+ return true;
+ else
+ return false;
+ }
+
+ public bool IsUnderTextArea(double x,double y)
+ {
+ if (x >= this.render.TextArea.X && x <= this.render.TextArea.Right && y > this.render.TextArea.Bottom)
+ return true;
+ else
+ return false;
+ }
+
///
/// ããããã¹ããè¡ã
///
@@ -204,8 +226,9 @@ namespace FooEditEngine
/// Rectã§æå®ãããç¯å²ã«ããã¥ã¡ã³ããæã
///
/// æåããç¯å²
- /// ãã£ã¬ãããç¹æ»
ãããå ´åãå®æçã®ãã®ã¡ã½ãããå¼ã³åºãã¦ãã ãã
- public override void Draw(Rectangle updateRect)
+ /// ãã£ãã·ã¥ããå
容ã使ç¨ããªãå ´åã¯çãæå®ãã
+ /// æåããç¯å²ãPageBoundããå°ããå ´åããã£ãã·ã¥ãããå
容ã使ç¨ãããã¨ãããã¾ãããªããã¬ã¿ãªã³ã°å¾ã«render.CacheContent()ãå¼ã³åºããªãã£ãå ´åã¯æ´æ°ç¯å²ã«ããããããã£ãã·ã¥ã使ç¨ãã¾ãã
+ public override void Draw(Rectangle updateRect,bool force = false)
{
if (this.LayoutLines.Count == 0)
return;
@@ -214,7 +237,8 @@ namespace FooEditEngine
if ((updateRect.Height < this.PageBound.Height ||
updateRect.Width < this.PageBound.Width) &&
- render.IsVaildCache())
+ render.IsVaildCache() &&
+ !force)
{
render.DrawCachedBitmap(updateRect);
}
@@ -229,11 +253,15 @@ namespace FooEditEngine
this.DrawLineMarker(this.Document.CaretPostion.row);
Point pos = this.render.TextArea.TopLeft;
- pos.X -= this.Src.X;
- //ç»é¢ä¸ã§ã¯(X,Y)ãéå§ä½ç½®ã«ãªãããéå§ããè¡ã決ã¾ã£ã¦ããã®ã§ãªãã»ãããæ±ãã
- pos.Y -= this.Src.GetOffsetY(this.render.emSize.Height);
+ //ç»é¢ä¸ã§ã¯è¡ããããã¦è¡¨ç¤ºãã
+ pos.Y += this.Src.OffsetY;
+
double endposy = this.render.TextArea.Bottom;
- Size lineNumberSize = new Size(this.render.LineNemberWidth,this.render.TextArea.Height);
+ Size lineNumberSize = new Size(this.render.LineNemberWidth, this.render.TextArea.Height);
+
+ this.render.BeginClipRect(new Rectangle(this.PageBound.X, this.render.TextArea.Y, this.PageBound.Width, this.render.TextArea.Height));
+
+ //ããã©ã¼ãã³ã¹åä¸ã®ããè¡çªå·ãªã©ãå
ã«æã
for (int i = this.Src.Row; i < this.LayoutLines.Count; i++)
{
int lineIndex = this.LayoutLines.GetIndexFromLineNumber(i);
@@ -247,20 +275,12 @@ namespace FooEditEngine
if (foldingData != null)
{
- if ((!this.LayoutLines.FoldingCollection.IsHasParent(foldingData) ||
- !this.LayoutLines.FoldingCollection.IsParentHidden(foldingData))
- && foldingData.IsFirstLine(this.LayoutLines, i))
- render.DrawFoldingMark(foldingData.Expand, this.PageBound.X + this.GetRealtiveX(AreaType.FoldingArea), pos.Y);
if (this.LayoutLines.FoldingCollection.IsHidden(lineIndex))
continue;
+ if (foldingData.IsFirstLine(this.LayoutLines, i) && foldingData.End >= lineIndex + lineLength)
+ render.DrawFoldingMark(foldingData.Expand, this.PageBound.X + this.GetRealtiveX(AreaType.FoldingArea), pos.Y);
}
- var selectRange = from s in this.Selections.Get(lineIndex, lineLength)
- let n = Util.ConvertAbsIndexToRelIndex(s, lineIndex, lineLength)
- select n;
-
- this.render.DrawOneLine(this.LayoutLines, i, pos.X, pos.Y, selectRange);
-
if (this.Document.DrawLineNumber)
{
this.render.DrawString((i + 1).ToString(), this.PageBound.X + this.GetRealtiveX(AreaType.LineNumberArea), pos.Y, StringAlignment.Right, lineNumberSize,StringColorType.LineNumber);
@@ -268,18 +288,52 @@ namespace FooEditEngine
DrawUpdateArea(i, pos.Y);
- pos.Y += this.LayoutLines.GetLayout(i).Height;
+ pos.Y += layout.Height;
+ //pos.Y += this.render.emSize.Height;
}
+ this.render.EndClipRect();
+
+ //ãªã»ããããªãã¨è¡ãæ£ããæããªã
+ pos = this.render.TextArea.TopLeft;
+ pos.X -= this.Src.X;
+ pos.Y += this.Src.OffsetY;
+
+ this.render.BeginClipRect(this.render.TextArea);
+
+ for (int i = this.Src.Row; i < this.LayoutLines.Count; i++)
+ {
+ int lineIndex = this.LayoutLines.GetIndexFromLineNumber(i);
+ int lineLength = this.LayoutLines.GetLengthFromLineNumber(i);
+ ITextLayout layout = this.LayoutLines.GetLayout(i);
+
+ if (pos.Y > endposy)
+ break;
+
+ FoldingItem foldingData = this.LayoutLines.FoldingCollection.Get(lineIndex, lineLength);
+
+ if (foldingData != null)
+ {
+ if (this.LayoutLines.FoldingCollection.IsHidden(lineIndex))
+ continue;
+ }
+
+ this.render.DrawOneLine(this.Document, this.LayoutLines, i, pos.X, pos.Y);
+
+ pos.Y += layout.Height;
+ }
+
+ this.render.EndClipRect();
+
this.DrawInsertPoint();
+ this.Document.SelectGrippers.BottomLeft.Draw(this.render);
+ this.Document.SelectGrippers.BottomRight.Draw(this.render);
+
render.CacheContent();
}
- this.DrawCaret();
-
- this.Document.SelectGrippers.BottomLeft.Draw(this.render);
- this.Document.SelectGrippers.BottomRight.Draw(this.render);
+ this.DrawCaret();
}
void DrawUpdateArea(int row,double ypos)
@@ -363,7 +417,7 @@ namespace FooEditEngine
{
TextPoint tp = this.GetLayoutLineFromIndex(sel.start);
Point left = this.GetPostionFromTextPoint(tp);
- double lineHeight = this.LayoutLines.GetLayout(tp.row).Height;
+ double lineHeight = render.emSize.Height;
Rectangle InsertRect = new Rectangle(left.X,
left.Y,
CaretWidthOnInsertMode,
@@ -373,24 +427,25 @@ namespace FooEditEngine
}
}
- void DrawCaret()
+ bool DrawCaret()
{
if (this.HideCaret || !this.IsFocused)
- return;
+ return false;
long diff = DateTime.Now.Ticks - this.tickCount;
long blinkTime = this.To100nsTime(this.CaretBlinkTime);
if (this.CaretBlink && diff % blinkTime >= blinkTime / 2)
- return;
+ return false;
Rectangle CaretRect = new Rectangle();
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 = render.emSize.Height;
+ double charWidth = layout.GetWidthFromIndex(this.Document.CaretPostion.col);
if (this.InsertMode || charWidth == 0)
{
@@ -405,6 +460,7 @@ namespace FooEditEngine
CaretRect.Location = new Point(this.CaretLocation.X, this.CaretLocation.Y + lineHeight - height);
render.FillRectangle(CaretRect, FillRectType.OverwriteCaret);
}
+ return true;
}
long To100nsTime(int ms)
@@ -418,7 +474,7 @@ namespace FooEditEngine
return;
IEditorRender render = (IEditorRender)base.render;
Point p = this.CaretLocation;
- double height = this.LayoutLines.GetLayout(this.Document.CaretPostion.row).Height;
+ double height = this.LayoutLines.GetLineHeight(this.Document.CaretPostion);
double width = this.render.TextArea.Width;
render.FillRectangle(new Rectangle(this.PageBound.X + this.render.TextArea.X, this.CaretLocation.Y, width, height), FillRectType.LineMarker);
}
@@ -433,7 +489,7 @@ namespace FooEditEngine
double width = layout.GetWidthFromIndex(this.Document.CaretPostion.col);
if (width == 0.0)
width = this.CaretWidthOnInsertMode;
- double height = layout.Height;
+ double height = this.LayoutLines.GetLineHeight(this.Document.CaretPostion);
Rectangle updateRect = new Rectangle(
this.CaretLocation.X,
this.CaretLocation.Y,
@@ -445,47 +501,63 @@ namespace FooEditEngine
///
/// æå®ãã座æ¨ã®ä¸çªè¿ãã«ããTextPointãåå¾ãã
///
- /// ããã¹ãã¨ãªã¢ãå·¦ä¸ã¨ããç¸å¯¾ä½ç½®
+ /// ãã¥ã¼ã¨ãªã¢ãå·¦ä¸ã¨ããç¸å¯¾ä½ç½®
+ /// æ¢ç´¢ç¯å²
/// ã¬ã¤ã¢ã¦ãã©ã¤ã³ãæã示ãTextPoint
- public TextPoint GetTextPointFromPostion(Point p)
+ public TextPoint GetTextPointFromPostion(Point p,TextPointSearchRange searchRange = TextPointSearchRange.TextAreaOnly)
{
- if (p.Y < this.render.TextArea.TopLeft.Y ||
- p.Y > this.render.TextArea.BottomRight.Y)
- return TextPoint.Null;
+ if(searchRange == TextPointSearchRange.TextAreaOnly)
+ {
+ if (p.Y < this.render.TextArea.TopLeft.Y ||
+ p.Y > this.render.TextArea.BottomRight.Y)
+ return TextPoint.Null;
+ }
+
TextPoint tp = new TextPoint();
if (this.LayoutLines.Count == 0)
return tp;
+ //表示é åããæ¢ç´¢ãå§ããã®ã§ããã£ã³ã°ã®åã ãå¼ã
p.Y -= this.render.TextArea.Y;
- int lineHeadIndex, lineLength;
- double y = 0;
- tp.row = this.LayoutLines.Count - 1;
- for (int i = this.Src.Row; i < this.LayoutLines.Count; i++)
+ //p.Y ã«æãè¿ãè¡ã調ã¹ã
+ var t = this.GetNearstRowAndOffsetY(this.Src.Row, p.Y);
+ double relX = 0, relY;
+ if (t == null)
{
- double height = this.LayoutLines.GetLayout(i).Height;
-
- lineHeadIndex = this.LayoutLines.GetIndexFromLineNumber(i);
- lineLength = this.LayoutLines.GetLengthFromLineNumber(i);
-
- if (this.LayoutLines.FoldingCollection.IsHidden(lineHeadIndex))
- continue;
-
- if (y + height > p.Y)
+ if(p.Y > 0)
{
- tp.row = i;
- break;
+ tp.row = this.LayoutLines.Count - 1;
+ relY = this.LayoutLines.GetLayout(tp.row).Height - this.render.emSize.Height;
+ }
+ else if(p.Y == 0)
+ {
+ tp.row = this.Src.Row;
+ relY = 0;
}
- y += height;
+ else
+ {
+ tp.row = 0;
+ relY = 0;
+ }
+ }
+ else
+ {
+ tp.row = t.Item1;
+ relY = t.Item2; //ç¸å¯¾ä½ç½®ããã¤ãã¹ãªã®ã§å転ããã
}
- if (p.X < this.render.TextArea.X)
- return tp;
+ if (searchRange == TextPointSearchRange.TextAreaOnly)
+ {
+ if (p.X < this.render.TextArea.X)
+ return tp;
+ }
- tp.col = GetIndexFromColPostion(tp.row, p.X);
+ relX = p.X - this.render.TextArea.X;
+ tp.col = this.LayoutLines.GetLayout(tp.row).GetIndexFromPostion(relX,relY);
- lineLength = this.LayoutLines.GetLengthFromLineNumber(tp.row);
+ int lineLength = this.LayoutLines.GetLengthFromLineNumber(tp.row);
if (tp.col > lineLength)
tp.col = lineLength;
@@ -493,34 +565,6 @@ namespace FooEditEngine
}
///
- /// æ¡æ¹åã®åº§æ¨ã«å¯¾å¿ããã¤ã³ããã¯ã¹ãåå¾ãã
- ///
- /// 対象ã¨ãªãè¡
- /// ããã¹ãã¨ãªã¢ããã®ç¸å¯¾ä½ç½®
- ///
- public int GetIndexFromColPostion(int row, double x)
- {
- x -= this.render.TextArea.X;
- int lineLength = this.LayoutLines.GetLengthFromLineNumber(row);
- if (lineLength == 0)
- return 0;
- int index = this.LayoutLines.GetLayout(row).GetIndexFromColPostion(this.Src.X + x);
- return index;
- }
-
- ///
- /// ã¤ã³ããã¯ã¹ã«å¯¾å¿ããæ¡æ¹åã®åº§æ¨ãå¾ã
- ///
- /// 対象ã¨ãªãè¡
- /// ã¤ã³ããã¯ã¹
- /// ããã¹ãã¨ãªã¢ããã®ç¸å¯¾ä½ç½®ãè¿ã
- public double GetColPostionFromIndex(int row, int index)
- {
- double x = this.LayoutLines.GetLayout(row).GetColPostionFromIndex(index);
- return x - Src.X + this.render.TextArea.X;
- }
-
- ///
/// TextPointã«å¯¾å¿ãã座æ¨ãå¾ã
///
/// ã¬ã¤ã¢ã¦ãã©ã¤ã³ä¸ã®ä½ç½®
@@ -536,8 +580,9 @@ namespace FooEditEngine
continue;
p.Y += this.LayoutLines.GetLayout(i).Height;
}
- p.X = this.GetColPostionFromIndex(tp.row, tp.col);
- p.Y += this.render.TextArea.Y;
+ Point relP = this.LayoutLines.GetLayout(tp.row).GetPostionFromIndex(tp.col);
+ p.X += relP.X - Src.X + this.render.TextArea.X;
+ p.Y += this.render.TextArea.Y + relP.Y;
return p;
}
@@ -558,11 +603,23 @@ namespace FooEditEngine
public Rectangle GetRectFromTextPoint(TextPoint tp, int width, int height)
{
+ if (tp.row < this.Src.Row)
+ return Rectangle.Empty;
+ //ç»é¢å¤ã«ããæã¯è¨ç®ããå¿
è¦ããããããªã
+ if (tp.row - this.Src.Row > this.LineCountOnScreen)
+ return Rectangle.Empty;
double radius = width / 2;
Point point = this.GetPostionFromTextPoint(tp);
- double lineHeight = this.LayoutLines.GetLayout(tp.row).Height;
+ double lineHeight = this.render.emSize.Height;
+ double srcOffsetY = this.Src.OffsetY; //ç»é¢ä¸ã§ã¯ããã¦ããã®ã§å¼ãå¿
è¦ããã
+
+ Rectangle rect = new Rectangle(point.X - radius, point.Y + lineHeight - srcOffsetY, width, height);
- return new Rectangle(point.X - radius, point.Y + lineHeight, width, height);
+ if (rect.BottomLeft.Y >= this.render.TextArea.BottomLeft.Y ||
+ rect.BottomRight.X < this.render.TextArea.BottomLeft.X ||
+ rect.BottomLeft.X > this.render.TextArea.BottomRight.X)
+ return Rectangle.Empty;
+ return rect;
}
///
@@ -587,7 +644,8 @@ namespace FooEditEngine
}
}
- this.Document.CaretPostion = new TextPoint(row, col);
+ //ã¤ãã³ãå¼ã³åºãã®åå
¥é²æ¢ã®ãã
+ this.Document.SetCaretPostionWithoutEvent(new TextPoint(row, col));
}
///
@@ -598,17 +656,17 @@ namespace FooEditEngine
public bool AdjustSrc(int index)
{
TextPoint startTextPoint = this.GetLayoutLineFromIndex(index);
- double x = this.LayoutLines.GetLayout(startTextPoint.row).GetColPostionFromIndex(startTextPoint.col);
- if (x < this.Src.X ||
- x > this.Src.X + this.PageBound.Width)
+ Point relP = this.LayoutLines.GetLayout(startTextPoint.row).GetPostionFromIndex(startTextPoint.col);
+ if (relP.X < this.Src.X ||
+ relP.X > this.Src.X + this.PageBound.Width)
{
- this.TryScroll(x, this.Src.Row);
+ this.TryScroll(relP.X, this.Src.Row);
return true;
}
if (startTextPoint.row < this.Src.Row ||
startTextPoint.row > this.Src.Row + this.LineCountOnScreenWithInVisible)
{
- this.TryScroll(this.Src.X, startTextPoint.row);
+ this.TryScroll(this.Src.X, startTextPoint.row, relP.Y);
return true;
}
return false;
@@ -633,10 +691,11 @@ namespace FooEditEngine
TextPoint tp = this.Document.CaretPostion;
double x = this.CaretLocation.X;
double y = this.CaretLocation.Y;
+ Point relPoint = this.LayoutLines.GetLayout(tp.row).GetPostionFromIndex(tp.col);
if (flow == AdjustFlow.Col || flow == AdjustFlow.Both)
{
- x = this.LayoutLines.GetLayout(tp.row).GetColPostionFromIndex(tp.col);
+ x = relPoint.X;
double left = this.Src.X;
double right = this.Src.X + this.render.TextArea.Width;
@@ -647,11 +706,11 @@ namespace FooEditEngine
}
else if (x > right) //xã¯è¡¨ç¤ºé åã®å³å´ã«ãã
{
- this.Document.Src = new SrcPoint(x - this.render.TextArea.Width + this.ScrollMarginWidth,this.Document.Src.Row,this.Document.Src.Y);
+ this.Document.Src = new SrcPoint(x - this.render.TextArea.Width + this.ScrollMarginWidth,this.Document.Src.Row,this.Document.Src.OffsetY);
if (this.Document.RightToLeft && this.Document.Src.X > 0)
{
System.Diagnostics.Debug.Assert(x > 0);
- this.Document.Src = new SrcPoint(0, this.Document.Src.Row, this.Document.Src.Y);
+ this.Document.Src = new SrcPoint(0, this.Document.Src.Row, this.Document.Src.OffsetY);
}
else
{
@@ -661,10 +720,10 @@ namespace FooEditEngine
}
else if (x < left) //xã¯è¡¨ç¤ºé åã®å·¦å´ã«ãã
{
- this.Document.Src = new SrcPoint(x - this.ScrollMarginWidth, this.Document.Src.Row, this.Document.Src.Y);
+ this.Document.Src = new SrcPoint(x - this.ScrollMarginWidth, this.Document.Src.Row, this.Document.Src.OffsetY);
if (!this.Document.RightToLeft && this.Document.Src.X < this.render.TextArea.X)
{
- this.Document.Src = new SrcPoint(0, this.Document.Src.Row, this.Document.Src.Y);
+ this.Document.Src = new SrcPoint(0, this.Document.Src.Row, this.Document.Src.OffsetY);
}
else
{
@@ -677,45 +736,46 @@ namespace FooEditEngine
if (flow == AdjustFlow.Row || flow == AdjustFlow.Both)
{
- int caretRow = 0;
- int lineCount = this.LineCountOnScreenWithInVisible;
- if (tp.row >= this.Src.Row && tp.row < this.Src.Row + lineCount)
+ int PhyLineCountOnScreen = (int)(this.render.TextArea.Height / this.render.emSize.Height);
+ //è¨ç®éãæ¸ãããã
+ if (tp.row < this.Src.Row || this.Src.Row + PhyLineCountOnScreen * 2 < tp.row)
+ this.Document.Src = new SrcPoint(this.Src.X, tp.row, -relPoint.Y);
+
+ //ãã£ã¬ããã®Y座æ¨ãæ±ãã
+ double lineHeight = this.render.emSize.Height;
+ double caret_y = this.Src.OffsetY; //src.rowãããã£ã¬ããä½ç½®
+ double alignedHeight = PhyLineCountOnScreen * lineHeight - lineHeight;
+ for (int i = this.Src.Row; i < tp.row; i++)
{
- caretRow = tp.row - this.Src.Row;
- y = -this.Src.GetOffsetY(this.render.emSize.Height); //ç»é¢ä¸ã§ã¯ããã¦ããã®ã§å¼ãå¿
è¦ããã
+ int lineHeadIndex = this.LayoutLines.GetIndexFromLineNumber(i);
+ int lineLength = this.LayoutLines.GetLengthFromLineNumber(i);
+
+ if (this.LayoutLines.FoldingCollection.IsHidden(lineHeadIndex))
+ continue;
+ caret_y += this.LayoutLines.GetLayout(i).Height;
}
- else if (tp.row >= this.Src.Row + lineCount)
+ caret_y += relPoint.Y;
+
+ if (caret_y < 0)
{
- int srcRow = this.GetSrcRow(tp.row, this.LineCountOnScreen);
- this.Document.Src = new SrcPoint(this.Document.Src.X, srcRow, srcRow * this.render.emSize.Height);
- caretRow = tp.row - this.Document.Src.Row;
+ this.Document.Src = new SrcPoint(this.Src.X, tp.row, -relPoint.Y);
y = 0;
- result = true;
- CalculateLineCountOnScreen();
}
- else if (tp.row < this.Src.Row)
+ else if (caret_y >= 0 && caret_y < alignedHeight)
{
- this.Document.Src = new SrcPoint(this.Document.Src.X, tp.row, tp.row * this.render.emSize.Height);
- y = 0;
- result = true;
- CalculateLineCountOnScreen();
+ y = caret_y;
}
-
- if (caretRow > 0)
+ else if(caret_y >= alignedHeight)
{
- for (int i = 0; i < caretRow; i++)
- {
- int currentRow = this.Src.Row + i;
- int lineHeadIndex = this.LayoutLines.GetIndexFromLineNumber(currentRow);
- int lineLength = this.LayoutLines.GetLengthFromLineNumber(currentRow);
-
- if (this.LayoutLines.FoldingCollection.IsHidden(lineHeadIndex))
- continue;
-
- y += this.LayoutLines.GetLayout(currentRow).Height;
- }
+ var newsrc = this.GetNearstRowAndOffsetY(tp.row, -(alignedHeight - relPoint.Y));
+ if(newsrc == null)
+ this.Document.Src = new SrcPoint(this.Src.X, tp.row, 0);
+ else
+ this.Document.Src = new SrcPoint(this.Src.X, newsrc.Item1, -newsrc.Item2);
+ y = alignedHeight;
}
y += this.render.TextArea.Y;
+ result = true;
}
this.SetCaretPostion(x, y);
@@ -728,23 +788,6 @@ namespace FooEditEngine
return result;
}
- int GetSrcRow(int row,int count)
- {
- if (this.LayoutLines.FoldingStrategy == null)
- return row - count;
- for (int i = row; i >= 0; i--)
- {
- int lineHeadIndex = this.LayoutLines.GetIndexFromLineNumber(i);
- int lineLength = this.LayoutLines.GetLengthFromLineNumber(i);
- if (this.LayoutLines.FoldingCollection.IsHidden(lineHeadIndex))
- continue;
- if (count <= 0)
- return i;
- count--;
- }
- return 0;
- }
-
///
/// ã¬ã¤ã¢ã¦ãè¡ãããã¹ããã¤ã³ãããã¤ã³ããã¯ã¹ã«å¤æãã
///
@@ -788,26 +831,6 @@ namespace FooEditEngine
}
///
- /// æå®ãã座æ¨ã¾ã§ã¹ã¯ãã¼ã«ãã
- ///
- ///
- ///
- ///
- /// ç¯å²å¤ã®åº§æ¨ãæå®ããå ´åãç¯å²å
ã«åã¾ãããã«èª¿æ´ããã¾ã
- ///
- public void Scroll(double x, double y)
- {
- if (x < 0)
- x = 0;
- if (y < 0)
- y = 0;
- double totalHeight = this.LayoutLines.Count * this.render.emSize.Height;
- if (y > totalHeight)
- y = totalHeight - this.render.TextArea.Height;
- base.TryScroll(x, y);
- }
-
- ///
/// æå®è¡ã¾ã§ã¹ã¯ãã¼ã«ãã
///
/// è¡