public SelectionRange(
CssBoxHitChain startChain,
CssBoxHitChain endChain,
IFonts ifonts)
{
if (IsOnTheSameLine(startChain, endChain))
{
//on the same line
if (endChain.RootGlobalX < startChain.RootGlobalX)
{
//swap
var tmp = endChain;
endChain = startChain;
startChain = tmp;
}
}
else
{
//across line
if (endChain.RootGlobalY < startChain.RootGlobalY)
{ //swap
var tmp = endChain;
endChain = startChain;
startChain = tmp;
}
}
//1.
this.SetupStartHitPoint(startChain, ifonts);
//2.
if (this.startHitHostLine == null)
{
this.isValid = false;
return;
}
this.SetupEndHitPoint(startChain, endChain, ifonts);
this.snapSelectionArea = this.GetSelectionRectArea();
}
public Rectangle SnapSelectionArea { get { return this.snapSelectionArea; } }