awulkiew / graphical-debugging

Graphical Debugging extension for Visual Studio
MIT License
150 stars 24 forks source link

Zoom display with free-selection area #41

Open arbitrary311 opened 3 years ago

arbitrary311 commented 3 years ago

Area selection for plot zoom in Geometry Watch and Plot Watch is currently constrained to the window's aspect ratio.

Would it be possible to add an option for free-area-selection (unconstrained) when doing zoom on a Geometry or Plot Watch? Presently it is constrained to the same aspect ratio of the window. It seems like it should only require the addition of a true/false selection in, e.g., GeometryWatchOptions.cs and a conditional statement in (e.g.) GeometryWatchControl.xaml.cs imageGrid_MouseMove(...). I tried editing that myself and it did allow me to create a selection box unconstrained, but it seems like the actual zoom is still constrained. I'm not as familiar with debugging something like this in C#, but I'm guessing it's either correcting the variables h and w in that method, or the method zoom in Viewport.cs is doing something. Thoughts?

awulkiew commented 3 years ago

Possible? Yes. Desireable? Probably not in both cases.

In Plot Watch it would be fine since the ratio is not that important, often one may want to use arbitrary axes. There is a PR already for that: https://github.com/awulkiew/graphical-debugging/pull/36

In Geometry Watch the shapes of geometries would be distorted. I don't understand why would you need this and incorrectly represent the ratios of coordinates. Am I missing something?

arbitrary311 commented 3 years ago

@awulkiew I see what I did wrong now after looking at the changes he made in that pull request (did not realize that was already being done, I only looked at the list of issues). I modified the same method, but my conditional flag did not wrap everything it needed to if I had free-selection turned on/off. By the way, in my local branch I added that as an option to Plot Watch and Geometry Watch.

In response to using it in Geometry Watch, if it's being used to display geometric shapes, yes, it would distort them as you pointed out. I personally use Geometry Watch for plotting lines between points instead of the icons in Plot Watch (e.g., position vs time trace). Depending on what exactly I'm looking at, sometimes the circle icons are better, e.g., if I want to be able to quickly identify a decrease in velocity from the spacing of the circles becoming smaller and overlapping (assuming uniform time intervals). I suppose it just depends on how the user is using it, hence an option for it, default false.

Possible? Yes. Desireable? Probably not in both cases.

In Plot Watch it would be fine since the ratio is not that important, often one may want to use arbitrary axes. There is a PR already for that: #36

In Geometry Watch the shapes of geometries would be distorted. I don't understand why would you need this and incorrectly represent the ratios of coordinates. Am I missing something?

awulkiew commented 3 years ago

@arbitrary311 You can change the way how plots are displayed by PlotWatch in the options (Tools->Options->Graphical Debugging) and set it to line-plot.