Exemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="logicalposition"></param>
 /// <returns></returns>
 private Point LogicalPosition2Point(LogicalPosition logicalposition)
 {
     float testHeight = 0F;
     int nlogical = 0;
     for (; ;)
     {
         if (nlogical >= logicalposition.Line)
             break;
         testHeight += list[nlogical + GetShowFirstLine()].Height;
         ++nlogical;
     }
     int y = (int)testHeight;
     int x;
     if (logicalposition.Line < 0)
     {
         x = -1;
     }
     else
     {
         MyLine line = list[logicalposition.Line + GetShowFirstLine()];
         if (logicalposition.Pos == 0)
             x = 0;
         else
             x = (int)line.GetWidth(0, logicalposition.Pos - 1);// 前の文字までの長さを取得
     }
     return new Point(x, y);
 }
Exemplo n.º 2
0
 /// <summary>
 /// LogicalPositionからPhysicalPositionに変換する
 /// </summary>
 /// <param name="logicalPosition"></param>
 /// <returns></returns>
 private PhysicalPosition LogicalPosition2PhysicalPosition(LogicalPosition logicalPosition)
 {
     return new PhysicalPosition(logicalPosition.Line + GetShowFirstLine(), logicalPosition.Pos);
 }