개정판 f011637d
issue #923 : 도면 Angle 값마다 Caret 값 보정
Change-Id: Id37dfb88e53ccb52e83f87a4d163e18f161757cc
MarkupToPDF/Controls/Text/ArrowTextControl.cs | ||
---|---|---|
92 | 92 |
/// </summary> |
93 | 93 |
public void MoveCustomCaret() |
94 | 94 |
{ |
95 |
var caretLocation = this.Base_TextBox.GetRectFromCharacterIndex(this.Base_TextBox.CaretIndex).Location; |
|
96 |
|
|
97 |
if (!double.IsInfinity(caretLocation.X)) |
|
98 |
{ |
|
99 |
if (Math.Abs(this.Angle) == 90) |
|
100 |
{ |
|
101 |
Canvas.SetLeft(this.BaseTextbox_Caret, this.EndPoint.X + caretLocation.Y); |
|
102 |
} |
|
103 |
else if (Math.Abs(this.Angle) == 180) |
|
104 |
{ |
|
105 |
|
|
106 |
Canvas.SetLeft(this.BaseTextbox_Caret, (this.EndPoint.X+ this.Base_TextBox.ActualWidth) - caretLocation.X) ; |
|
107 |
} |
|
108 |
else if (Math.Abs(this.Angle) == 270) |
|
109 |
{ |
|
110 |
Canvas.SetLeft(this.BaseTextbox_Caret, (this.EndPoint.X) - caretLocation.Y); |
|
111 |
} |
|
112 |
else |
|
113 |
{ |
|
114 |
Canvas.SetLeft(this.BaseTextbox_Caret, this.EndPoint.X + caretLocation.X); |
|
115 |
} |
|
116 |
} |
|
117 |
|
|
118 |
if (!double.IsInfinity(caretLocation.Y)) |
|
119 |
{ |
|
120 |
if (Math.Abs(this.Angle) == 90) |
|
121 |
{ |
|
122 |
Canvas.SetTop(this.BaseTextbox_Caret, this.EndPoint.Y - caretLocation.X); |
|
123 |
} |
|
124 |
else if (Math.Abs(this.Angle) == 180) |
|
125 |
{//보정치40 |
|
126 |
Canvas.SetTop(this.BaseTextbox_Caret, ((this.EndPoint.Y -40) + this.Base_TextBox.ActualHeight)- caretLocation.Y ); |
|
127 |
} |
|
128 |
else if (Math.Abs(this.Angle) == 270) |
|
129 |
{ |
|
130 |
Canvas.SetTop(this.BaseTextbox_Caret, (this.EndPoint.Y) + caretLocation.X); |
|
131 |
} |
|
132 |
else |
|
133 |
{ |
|
134 |
Canvas.SetTop(this.BaseTextbox_Caret, this.EndPoint.Y + caretLocation.Y); |
|
135 |
} |
|
136 |
} |
|
137 |
} |
|
138 |
|
|
139 |
public void MoveCustomCaret(Point point) |
|
140 |
{ |
|
95 | 141 |
|
96 | 142 |
var caretLocation = this.Base_TextBox.GetRectFromCharacterIndex(this.Base_TextBox.CaretIndex).Location; |
97 | 143 |
|
98 | 144 |
if (!double.IsInfinity(caretLocation.X)) |
99 | 145 |
{ |
100 |
|
|
101 |
Canvas.SetLeft(this.BaseTextbox_Caret, this.EndPoint.X + caretLocation.X); |
|
146 |
if (Math.Abs(this.Angle) == 90) |
|
147 |
{ |
|
148 |
Canvas.SetLeft(this.BaseTextbox_Caret, point.X + caretLocation.Y); |
|
149 |
} |
|
150 |
else if (Math.Abs(this.Angle) == 180) |
|
151 |
{ |
|
152 |
|
|
153 |
Canvas.SetLeft(this.BaseTextbox_Caret, (point.X + this.Base_TextBox.ActualWidth) - caretLocation.X); |
|
154 |
} |
|
155 |
else if (Math.Abs(this.Angle) == 270) |
|
156 |
{ |
|
157 |
Canvas.SetLeft(this.BaseTextbox_Caret, (point.X) - caretLocation.Y); |
|
158 |
} |
|
159 |
else |
|
160 |
{ |
|
161 |
Canvas.SetLeft(this.BaseTextbox_Caret, point.X + caretLocation.X); |
|
162 |
} |
|
102 | 163 |
} |
103 | 164 |
|
104 | 165 |
if (!double.IsInfinity(caretLocation.Y)) |
105 | 166 |
{ |
106 |
Canvas.SetTop(this.BaseTextbox_Caret, this.EndPoint.Y + caretLocation.Y); |
|
167 |
if (Math.Abs(this.Angle) == 90) |
|
168 |
{ |
|
169 |
Canvas.SetTop(this.BaseTextbox_Caret, point.Y - caretLocation.X); |
|
170 |
} |
|
171 |
else if (Math.Abs(this.Angle) == 180) |
|
172 |
{ |
|
173 |
Canvas.SetTop(this.BaseTextbox_Caret, (point.Y + this.Base_TextBox.ActualHeight) - caretLocation.Y); |
|
174 |
} |
|
175 |
else if (Math.Abs(this.Angle) == 270) |
|
176 |
{ |
|
177 |
Canvas.SetTop(this.BaseTextbox_Caret, (point.Y) + caretLocation.X); |
|
178 |
} |
|
179 |
else |
|
180 |
{ |
|
181 |
Canvas.SetTop(this.BaseTextbox_Caret, point.Y + caretLocation.Y); |
|
182 |
} |
|
107 | 183 |
} |
108 | 184 |
} |
109 | 185 |
|
... | ... | |
1227 | 1303 |
this.Base_ArrowSubPath.RenderTransformOrigin = new Point(0, 0); |
1228 | 1304 |
|
1229 | 1305 |
Base_TextBox.RenderTransformOrigin = new Point(0, 0); |
1306 |
BaseTextbox_Caret.RenderTransformOrigin = new Point(0, 0); |
|
1230 | 1307 |
} |
1231 | 1308 |
|
1232 | 1309 |
Base_ArrowSubPath.RenderTransform = new RotateTransform |
내보내기 Unified diff