개정판 d128ceb2
issue #923: add UndoCommand
Change-Id: I7bb9cf1d4276c75e50906b7f4672433afc233e15
MarkupToPDF/Controls/Text/ArrowTextControl.cs | ||
---|---|---|
1157 | 1157 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxHeight / 2)); //좌단 |
1158 | 1158 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth, Canvas.GetTop(Base_TextBox) + this.BoxHeight / 2)); //우단 |
1159 | 1159 |
|
1160 |
#region 정밀도 추가 |
|
1161 |
//ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //상단 |
|
1162 |
//ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth, Canvas.GetTop(Base_TextBox))); //상단 |
|
1163 |
//ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxHeight)); //좌단 |
|
1164 |
//ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth, Canvas.GetTop(Base_TextBox) + this.BoxHeight)); //상단 |
|
1165 |
#endregion |
|
1166 |
|
|
1167 |
|
|
1168 |
|
|
1169 |
|
|
1170 |
//ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth, Canvas.GetTop(Base_TextBox))); |
|
1171 |
//ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); |
|
1172 |
//ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxHeight)); |
|
1173 |
//ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth, Canvas.GetTop(Base_TextBox) + this.BoxHeight)); |
|
1174 |
|
|
1175 | 1160 |
if (isTrans) |
1176 | 1161 |
{ |
1177 | 1162 |
switch (Math.Abs(this.Angle).ToString()) |
... | ... | |
1212 | 1197 |
default: |
1213 | 1198 |
break; |
1214 | 1199 |
} |
1215 |
|
|
1216 | 1200 |
|
1217 | 1201 |
var endP = MathSet.getNearPoint(ps, this.MidPoint); |
1218 | 1202 |
|
1219 |
|
|
1220 |
|
|
1221 | 1203 |
//20180911 LJY 꺾이는 부분 수정 |
1222 | 1204 |
Point testP = endP; |
1223 | 1205 |
switch (Math.Abs(this.Angle).ToString()) |
... | ... | |
1315 | 1297 |
|
1316 | 1298 |
//20180910 LJY 각도에 따라. |
1317 | 1299 |
this.MidPoint = testP; |
1318 |
//instanceGroup.Children.Add(SingleAllow(this.MidPoint, this.StartPoint, this.LineSize)); |
|
1319 | 1300 |
instanceGroup.Children.Add(DrawSet.DrawArrow(testP, this.StartPoint, this.LineSize)); |
1320 | 1301 |
} |
1321 | 1302 |
else |
... | ... | |
1361 | 1342 |
|
1362 | 1343 |
|
1363 | 1344 |
var endP = MathSet.getNearPoint(ps, this.MidPoint); |
1364 |
//connectorMEGeometry.EndPoint = endP; |
|
1365 |
//connectorMEGeometry.EndPoint = endP; |
|
1366 | 1345 |
connectorMEGeometry.EndPoint = endP; //최상단 |
1367 | 1346 |
//connectorMEGeometry.EndPoint = this.EndPoint; //핵심 |
1368 | 1347 |
//this.MidPoint= MathSet.getMiddlePoint(this.StartPoint, endP); |
1369 | 1348 |
#region 보정치 |
1370 |
//enP는 그 점 |
|
1371 |
//Point testP = new Point(endP.X-100,endP.Y); |
|
1372 |
|
|
1373 | 1349 |
Point testP = endP; |
1374 |
|
|
1375 |
|
|
1376 |
//Point testP = new Point(endP.X, endP.Y - 50); |
|
1377 |
|
|
1378 |
/* 20180910 LJY TEST 주석 |
|
1379 |
if (isFixed) |
|
1380 |
{ |
|
1381 |
if (ps[0] == endP) //상단 |
|
1382 |
{ |
|
1383 |
testP = new Point(endP.X, endP.Y - 50); |
|
1384 |
//System.Diagnostics.Debug.WriteLine("상단"); |
|
1385 |
} |
|
1386 |
else if (ps[1] == endP) //하단 |
|
1387 |
{ |
|
1388 |
testP = new Point(endP.X, endP.Y + 50); |
|
1389 |
//System.Diagnostics.Debug.WriteLine("하단"); |
|
1390 |
} |
|
1391 |
else if (ps[2] == endP) //좌단 |
|
1392 |
{ |
|
1393 |
testP = new Point(endP.X - 50, endP.Y); |
|
1394 |
//System.Diagnostics.Debug.WriteLine("좌단"); |
|
1395 |
} |
|
1396 |
else if (ps[3] == endP) //우단 |
|
1397 |
{ |
|
1398 |
testP = new Point(endP.X + 50, endP.Y); |
|
1399 |
//System.Diagnostics.Debug.WriteLine("우단"); |
|
1400 |
} |
|
1401 |
} |
|
1402 |
*/ |
|
1403 | 1350 |
|
1404 | 1351 |
//20180910 LJY 각도에 따라. |
1405 | 1352 |
switch (Math.Abs(this.Angle).ToString()) |
... | ... | |
1484 | 1431 |
|
1485 | 1432 |
connectorSMGeometry.EndPoint = testP; |
1486 | 1433 |
connectorMEGeometry.StartPoint = testP; |
1487 |
//connectorSMGeometry.EndPoint = endP; |
|
1488 |
//connectorMEGeometry.StartPoint = endP; |
|
1489 | 1434 |
instanceGroup.Children.Add(DrawSet.DrawArrow(testP, this.StartPoint, this.LineSize)); |
1490 | 1435 |
#endregion |
1491 | 1436 |
} |
... | ... | |
1513 | 1458 |
SubPathFill = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.Yellow.R, Colors.Yellow.G, Colors.Yellow.B)); |
1514 | 1459 |
BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.Yellow.R, Colors.Yellow.G, Colors.Yellow.B)); |
1515 | 1460 |
|
1516 |
//Base_ArrowSubPath.Fill = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.Yellow.R, Colors.Yellow.G, Colors.Yellow.B)); |
|
1517 |
|
|
1518 | 1461 |
TextBoxBackground = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.Yellow.R, Colors.Yellow.G, Colors.Yellow.B)); |
1519 |
//Base_TextBox.Background = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.Yellow.R, Colors.Yellow.G, Colors.Yellow.B)); |
|
1520 | 1462 |
} |
1521 | 1463 |
else |
1522 | 1464 |
{ |
1523 | 1465 |
BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B)); |
1524 | 1466 |
SubPathFill = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B)); |
1525 | 1467 |
TextBoxBackground = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.1), Colors.White.R, Colors.White.G, Colors.White.B)); |
1526 |
|
|
1527 |
//Base_ArrowSubPath.Fill = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B)); |
|
1528 |
//Base_TextBox.Background = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B)); |
|
1529 | 1468 |
} |
1530 | 1469 |
|
1531 | 1470 |
instanceGroup.Children.Add(connectorSMGeometry); |
1532 | 1471 |
instanceGroup.Children.Add(connectorMEGeometry); |
1533 | 1472 |
|
1534 |
//이미 바인딩 되어있음 |
|
1535 |
//this.Base_ArrowPath.Stroke = this.StrokeColor; |
|
1536 |
|
|
1537 | 1473 |
this.PathData = instanceGroup; |
1538 | 1474 |
OverViewPathData = PathData; |
1539 | 1475 |
OverViewArrowText = ArrowText; |
1540 | 1476 |
OverViewEndPoint = connectorMEGeometry.EndPoint; |
1541 | 1477 |
OverViewStartPoint = connectorSMGeometry.StartPoint; |
1542 |
//OverViewText = Text; |
|
1543 | 1478 |
|
1544 |
//Base_ArrowSubPath.Data = instanceSubGroup; |
|
1545 |
//Angle = Math.Abs(this.Angle); |
|
1546 | 1479 |
var tempAngle = Math.Abs(this.Angle); |
1547 | 1480 |
|
1548 | 1481 |
if (tempAngle == Convert.ToDouble(90) || tempAngle == Convert.ToDouble(270)) |
1549 | 1482 |
{ |
1550 |
////this.Angle = 90; |
|
1551 |
|
|
1552 | 1483 |
this.RenderTransformOrigin = new Point(0.5, 0.5); |
1553 | 1484 |
this.Base_ArrowPath.RenderTransformOrigin = new Point(0, 0); |
1554 | 1485 |
this.Base_ArrowSubPath.RenderTransformOrigin = new Point(0, 0); |
1555 | 1486 |
|
1556 | 1487 |
Base_TextBox.RenderTransformOrigin = new Point(0, 0); |
1557 |
|
|
1558 | 1488 |
} |
1559 | 1489 |
|
1560 | 1490 |
Base_ArrowSubPath.RenderTransform = new RotateTransform |
... | ... | |
1563 | 1493 |
CenterX = this.EndPoint.X, |
1564 | 1494 |
CenterY = this.EndPoint.Y, |
1565 | 1495 |
}; |
1566 |
|
|
1567 |
//Base_ArrowPath.StrokeThickness = 3; |
|
1568 |
//Base_ArrowSubPath.StrokeThickness = 3; |
|
1569 |
|
|
1570 | 1496 |
} |
1571 | 1497 |
|
1572 | 1498 |
private void DrawingCloud() |
내보내기 Unified diff