wieslawsoltes / PanAndZoom

Pan and zoom control for Avalonia.
http://wieslawsoltes.github.io/PanAndZoom/
MIT License
345 stars 45 forks source link

How much zoom is applied? #10

Closed JobaDiniz closed 7 years ago

JobaDiniz commented 7 years ago

How do I get how much zoom is applied?

wieslawsoltes commented 7 years ago

Currently there is no property exposed with current zoom value. I should probably add this. I only use InvalidatedChild callback action which is called everytime zoom changes. First two parameters are zoom in X and Y axis, last two are current pan offsets in X and Y axis.

wieslawsoltes commented 7 years ago

It will be possible using following properties:

/// <summary>
/// Gets the zoom ratio for x axis.
/// </summary>
double ZoomX { get; }

/// <summary>
/// Gets the zoom ratio for y axis.
/// </summary>
double ZoomY { get; }

/// <summary>
/// Gets the pan offset for x axis.
/// </summary>
double OffsetX { get; }

/// <summary>
/// Gets the pan offset for y axis.
/// </summary>
double OffsetY { get; }

after #12 PR will get merged.

JobaDiniz commented 7 years ago

Hi, those properties should be "bindable", that is, they should be DependencyProperty otherwise I cannot bind to them.

Can you make these changes?

wieslawsoltes commented 7 years ago

@JobaDiniz Fixed in master.