Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
Fixed 1:1 perspective resizing bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhonfi committed Nov 24, 2015
1 parent 1a7b95d commit 34b88fc
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions Source/Graph#.Controls/Controls/Zoom/ZoomControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,30 @@ public override void OnApplyTemplate()
Presenter = GetTemplateChild(PartPresenter) as ZoomContentPresenter;
if (Presenter != null)
{
Presenter.SizeChanged += (s, a) => DoZoomToFill();
Presenter.ContentSizeChanged += (s, a) => DoZoomToFill();
Presenter.SizeChanged += (s, a) =>
{
if (Mode == ZoomControlModes.Fill)
{
DoZoomToFill();
}
else if(Mode == ZoomControlModes.Original)
{
var initialTranslate = GetInitialTranslate();
DoZoomAnimation(Zoom, initialTranslate.X * Zoom, initialTranslate.Y * Zoom);
}
};
Presenter.ContentSizeChanged += (s, a) =>
{
if (Mode == ZoomControlModes.Fill)
{
DoZoomToFill();
}
else if (Mode == ZoomControlModes.Original)
{
var initialTranslate = GetInitialTranslate();
DoZoomAnimation(Zoom, initialTranslate.X * Zoom, initialTranslate.Y * Zoom);
}
};
}
ZoomToFill();
}
Expand Down

0 comments on commit 34b88fc

Please sign in to comment.