개정판 ab7fe8c0
Fix: Sign, Image Control에서 AxisLock이 설정되어 있으면 혹은 Shift Key를 누르면 크기를 정비율로 수정되도록 수정
Change-Id: I2f4b32afd4792e40bc896de780751c4680c9deee
MarkupToPDF/Controls/Etc/SignControl.cs | ||
---|---|---|
370 | 370 |
} |
371 | 371 |
} |
372 | 372 |
|
373 |
var ReverseP = (i + path.PointSet.Count() / 2) % path.PointSet.Count();
|
|
374 |
var PreviousP = (i + (path.PointSet.Count() - 1)) % path.PointSet.Count();
|
|
375 |
var NextP = (i + 1) % path.PointSet.Count();
|
|
373 |
var OppositeP = (i + path.PointSet.Count / 2) % path.PointSet.Count;
|
|
374 |
var PreviousP = (i + (path.PointSet.Count - 1)) % path.PointSet.Count;
|
|
375 |
var NextP = (i + 1) % path.PointSet.Count; |
|
376 | 376 |
|
377 |
var distance = MathSet.DistanceTo(path.PointSet[ReverseP], path.PointSet[i]); |
|
377 |
if (bAxisLocked) |
|
378 |
{ |
|
379 |
double _dx = path.PointSet[i].X - path.PointSet[OppositeP].X; |
|
380 |
double _dy = path.PointSet[i].Y - path.PointSet[OppositeP].Y; |
|
381 |
double distance = Math.Max(Math.Abs(_dx), Math.Abs(_dy)); |
|
382 |
|
|
383 |
var PreviousV = path.PointSet[PreviousP] - path.PointSet[OppositeP]; |
|
384 |
PreviousV.Normalize(); |
|
385 |
path.PointSet[PreviousP] = path.PointSet[OppositeP] + PreviousV * distance; |
|
378 | 386 |
|
379 |
var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[PreviousP]); |
|
380 |
var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X, |
|
381 |
path.PointSet[i].Y - path.PointSet[ReverseP].Y); |
|
382 |
path.PointSet[PreviousP] = new Point(path.PointSet[ReverseP].X + PreviousV.X * l, path.PointSet[ReverseP].Y + PreviousV.Y * l); |
|
387 |
var NextV = path.PointSet[NextP] - path.PointSet[OppositeP]; |
|
388 |
NextV.Normalize(); |
|
389 |
path.PointSet[NextP] = path.PointSet[OppositeP] + NextV * distance; |
|
383 | 390 |
|
384 |
var NextV = MathSet.GetNormVectorBetween(path.PointSet[ReverseP], path.PointSet[NextP]); |
|
385 |
l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[ReverseP].X, path.PointSet |
|
386 |
[i].Y - path.PointSet[ReverseP].Y); |
|
387 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
|
391 |
path.PointSet[i] = path.PointSet[OppositeP] + PreviousV * distance + NextV * distance; |
|
392 |
} |
|
393 |
else |
|
394 |
{ |
|
395 |
var PreviousV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[PreviousP]); |
|
396 |
var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X, |
|
397 |
path.PointSet[i].Y - path.PointSet[OppositeP].Y); |
|
398 |
path.PointSet[PreviousP] = new Point(path.PointSet[OppositeP].X + PreviousV.X * l, path.PointSet[OppositeP].Y + PreviousV.Y * l); |
|
399 |
|
|
400 |
var NextV = MathSet.GetNormVectorBetween(path.PointSet[OppositeP], path.PointSet[NextP]); |
|
401 |
l = MathSet.DotProduct(NextV.X, NextV.Y, path.PointSet[i].X - path.PointSet[OppositeP].X, path.PointSet |
|
402 |
[i].Y - path.PointSet[OppositeP].Y); |
|
403 |
path.PointSet[NextP] = new Point(path.PointSet[OppositeP].X + NextV.X * l, path.PointSet[OppositeP].Y + NextV.Y * l); |
|
404 |
} |
|
388 | 405 |
|
389 | 406 |
this.UpdateControl(); |
390 | 407 |
} |
내보내기 Unified diff