개정판 ab7fe8c0
Fix: Sign, Image Control에서 AxisLock이 설정되어 있으면 혹은 Shift Key를 누르면 크기를 정비율로 수정되도록 수정
Change-Id: I2f4b32afd4792e40bc896de780751c4680c9deee
MarkupToPDF/Controls/Etc/SymControlN.cs | ||
---|---|---|
408 | 408 |
} |
409 | 409 |
} |
410 | 410 |
|
411 |
var ReverseP = (i + path.PointSet.Count / 2) % path.PointSet.Count;
|
|
411 |
var OppositeP = (i + path.PointSet.Count / 2) % path.PointSet.Count;
|
|
412 | 412 |
var PreviousP = (i + (path.PointSet.Count - 1)) % path.PointSet.Count; |
413 | 413 |
var NextP = (i + 1) % path.PointSet.Count; |
414 |
if (bAxisLocked) |
|
415 |
{ |
|
416 |
double _dx = path.PointSet[i].X - path.PointSet[OppositeP].X; |
|
417 |
double _dy = path.PointSet[i].Y - path.PointSet[OppositeP].Y; |
|
418 |
double distance = Math.Max(Math.Abs(_dx), Math.Abs(_dy)); |
|
414 | 419 |
|
415 |
var distance = MathSet.DistanceTo(path.PointSet[ReverseP], path.PointSet[i]); |
|
420 |
var PreviousV = path.PointSet[PreviousP] - path.PointSet[OppositeP]; |
|
421 |
PreviousV.Normalize(); |
|
422 |
path.PointSet[PreviousP] = path.PointSet[OppositeP] + PreviousV * distance; |
|
416 | 423 |
|
417 |
var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[PreviousP]); |
|
418 |
var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X, |
|
419 |
path.PointSet[i].Y - path.PointSet[ReverseP].Y); |
|
420 |
path.PointSet[PreviousP] = new Point(path.PointSet[ReverseP].X + PreviousV.X * l, path.PointSet[ReverseP].Y + PreviousV.Y * l); |
|
424 |
var NextV = path.PointSet[NextP] - path.PointSet[OppositeP]; |
|
425 |
NextV.Normalize(); |
|
426 |
path.PointSet[NextP] = path.PointSet[OppositeP] + NextV * distance; |
|
421 | 427 |
|
422 |
var NextV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[NextP]); |
|
423 |
l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X, path.PointSet |
|
424 |
[i].Y - path.PointSet[ReverseP].Y); |
|
425 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
|
428 |
path.PointSet[i] = path.PointSet[OppositeP] + PreviousV * distance + NextV * distance; |
|
429 |
} |
|
430 |
else |
|
431 |
{ |
|
432 |
var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[PreviousP]); |
|
433 |
var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X, |
|
434 |
path.PointSet[i].Y - path.PointSet[OppositeP].Y); |
|
435 |
path.PointSet[PreviousP] = new Point(path.PointSet[OppositeP].X + PreviousV.X * l, path.PointSet[OppositeP].Y + PreviousV.Y * l); |
|
436 |
|
|
437 |
var NextV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[NextP]); |
|
438 |
l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X, path.PointSet |
|
439 |
[i].Y - path.PointSet[OppositeP].Y); |
|
440 |
path.PointSet[NextP] = new Point(path.PointSet[OppositeP].X + NextV.X * l, path.PointSet[OppositeP].Y + NextV.Y * l); |
|
441 |
} |
|
426 | 442 |
|
427 | 443 |
this.UpdateControl(); |
428 | 444 |
} |
내보내기 Unified diff