개정판 3b797b23
Fix: CircleControl 회전 적용 중...
Change-Id: I4711f5cc93af7158369d745d9efa765491060841
MarkupToPDF/Controls/Shape/CircleControl.cs | ||
---|---|---|
279 | 279 |
get { return (double)GetValue(AngleProperty); } |
280 | 280 |
set { SetValue(AngleProperty, value); } |
281 | 281 |
} |
282 |
public double CommentAngle |
|
282 |
public override double CommentAngle
|
|
283 | 283 |
{ |
284 | 284 |
get { return (double)GetValue(AngleProperty); } |
285 | 285 |
set |
... | ... | |
360 | 360 |
if (PropertyChanged != null) |
361 | 361 |
PropertyChanged(this, new PropertyChangedEventArgs(propName)); |
362 | 362 |
} |
363 |
|
|
364 |
/// <summary> |
|
365 |
/// Circle을 생성한다. |
|
366 |
/// </summary> |
|
363 | 367 |
private void SetCircle() |
364 | 368 |
{ |
365 | 369 |
Base_CirclePath.StrokeDashArray.Clear(); |
... | ... | |
371 | 375 |
|
372 | 376 |
Point middle = MathSet.getMiddlePoint(this.EndPoint, this.StartPoint); |
373 | 377 |
|
374 |
instance.RadiusX = (MathSet.DistanceTo(this.LeftBottomPoint, this.EndPoint) / 2);
|
|
375 |
instance.RadiusY = (MathSet.DistanceTo(this.EndPoint, this.TopRightPoint) / 2);
|
|
378 |
instance.RadiusX = (MathSet.DistanceTo(this.LeftBottomPoint, this.EndPoint) * 0.5);
|
|
379 |
instance.RadiusY = (MathSet.DistanceTo(this.EndPoint, this.TopRightPoint) * 0.5);
|
|
376 | 380 |
instance.Center = middle; |
381 |
#region 회전 적용 |
|
382 |
var rot = new RotateTransform(this.CommentAngle, middle.X, middle.Y); |
|
383 |
instance.Transform = rot; |
|
384 |
#endregion |
|
385 |
|
|
377 | 386 |
switch (this.Paint) |
378 | 387 |
{ |
379 | 388 |
case PaintSet.None: |
... | ... | |
391 | 400 |
break; |
392 | 401 |
} |
393 | 402 |
|
394 |
|
|
395 | 403 |
CircleGroup.Children.Clear(); |
396 | 404 |
CircleGroup.FillRule = FillRule.Nonzero; |
397 | 405 |
CircleGroup.Children.Add(instance); |
406 |
CircleGroup.Children.Add(new LineGeometry(this.StartPoint, this.LeftBottomPoint)); |
|
407 |
CircleGroup.Children.Add(new LineGeometry(this.LeftBottomPoint, this.EndPoint)); |
|
408 |
CircleGroup.Children.Add(new LineGeometry(this.EndPoint, this.TopRightPoint)); |
|
409 |
CircleGroup.Children.Add(new LineGeometry(this.TopRightPoint, this.StartPoint)); |
|
398 | 410 |
|
399 | 411 |
try |
400 | 412 |
{ |
401 |
//강인구 수정(원 테두리가 잘리는것 방지) |
|
402 |
//this.Width = Math.Abs(this.CircleGroup.Bounds.Right + 2); |
|
403 |
//this.Height = Math.Abs(this.CircleGroup.Bounds.Bottom + 2); |
|
404 |
this.Width = Math.Abs(this.CircleGroup.Bounds.Right + (this.LineSize / 2)); |
|
405 |
this.Height = Math.Abs(this.CircleGroup.Bounds.Bottom + +(this.LineSize / 2)); |
|
413 |
this.Width = Math.Abs(this.CircleGroup.Bounds.Right + (this.LineSize * 0.5)); |
|
414 |
this.Height = Math.Abs(this.CircleGroup.Bounds.Bottom + +(this.LineSize * 0.5)); |
|
406 | 415 |
} |
407 | 416 |
catch (Exception) |
408 | 417 |
{ |
409 | 418 |
|
410 |
} |
|
419 |
} |
|
420 |
|
|
411 | 421 |
CenterX = Math.Abs(this.CircleGroup.Bounds.X / 2); |
412 | 422 |
CenterY = Math.Abs(this.CircleGroup.Bounds.Y / 2); |
413 | 423 |
this.PathData = CircleGroup; |
내보내기 Unified diff