❔ Pan and zoom control zooms into the top left once the content width exceeds the parent width (WPF)
I made a control similar to the view box with a horizontal/vertical offset (for panning) and a zoom scale. The main parts are the arrange and measure functions:
My problem is that when I increase the zoom to the point where the child's visual size (size after scaling) exceeds the size of the parent (in both the width or height), it starts zooming towards the top left corner, whereas normally it zooms towards the center. Anyone know why it's doing this?
2 Replies
Nevermind i fixed it by removing those 3 lines after calling the child's measure function, meaning the arrange function only receives the size of the control itself instead of being affected by the child control's size
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.