tp = this.View.GetTextPointFromPostion(hittedGripper.AdjustPoint(p), searchRange);
if (tp == TextPoint.Null)
return false;
- if (this.IsReverseSelect())
- {
- if (Object.ReferenceEquals(hittedGripper, this.Document.SelectGrippers.BottomRight))
- this.MoveSelectBefore(tp);
- else
- this.MoveCaretAndSelect(tp);
- }
- else
- {
- if (Object.ReferenceEquals(hittedGripper, this.Document.SelectGrippers.BottomLeft))
- this.MoveSelectBefore(tp);
- else
- this.MoveCaretAndSelect(tp);
- }
- hittedGripper.Move(this.View, tp);
+ if (Object.ReferenceEquals(hittedGripper, this.Document.SelectGrippers.BottomRight))
+ this.MoveCaretAndSelect(tp);
+ else if(Object.ReferenceEquals(hittedGripper, this.Document.SelectGrippers.BottomLeft))
+ this.MoveSelectBefore(tp);
}
else
{
//こうしないと選択できなくなってしまう
this.nowCaretMove = true;
SetValue(SelectedTextProperty, this._Controller.SelectedText);
- SetValue(SelectionProperty, new TextRange(this._Controller.SelectionStart, this._Controller.SelectionLength));
SetValue(CaretPostionPropertyKey, this.Document.CaretPostion);
this.nowCaretMove = false;
- this.Document.SelectGrippers.BottomLeft.MoveByIndex(this.View, this.Controller.SelectionStart);
- this.Document.SelectGrippers.BottomRight.MoveByIndex(this.View, this.Controller.SelectionStart + this.Controller.SelectionLength);
+ System.Diagnostics.Debug.WriteLine("selected start:{0} len:{1}", this._Controller.SelectionStart, this._Controller.SelectionLength);
+ if (this._Controller.IsReverseSelect())
+ {
+ this.Document.SelectGrippers.BottomRight.MoveByIndex(this.View, this.Controller.SelectionStart);
+ this.Document.SelectGrippers.BottomLeft.MoveByIndex(this.View, this.Controller.SelectionStart + this.Controller.SelectionLength);
+ }
+ else
+ {
+ this.Document.SelectGrippers.BottomLeft.MoveByIndex(this.View, this.Controller.SelectionStart);
+ this.Document.SelectGrippers.BottomRight.MoveByIndex(this.View, this.Controller.SelectionStart + this.Controller.SelectionLength);
+ }
if (this.textStore.IsLocked() == false)
this.textStore.NotifySelectionChanged();
}