Range for Crop patch dimensions to fit Screen Dimensions?
Since the size of the image I'm displaying is a larger texture than what the billboard patch can render, I need to crop it to the section I wish to display.
Since I want to pan around the image with mouse, I need to update the crop dimensions as user drags. The crop patch is hard-wired to pixel co-ordinates of the mouse ATM.*
I want to put in a hard limit on how far (how much) the image will crop so that when the image is dragged to the edge of Window the cropping ceases to stop the image from shrinking the way it does in my composition.
In the given example shrinking starts when Crop X <0 or Crop X >360; or when Crop Y <> 0. But I can hard-code those numbers since a window resize or image zoom changes everything. (There is a Zoom control published to Root which you can change).
I'm having trouble discerning what the relationship of the Crop Inputs and the screen edges is.
*At moment it just follows the mouse since I haven't written the 'dragging' code to detect mouse-down and update co-ordinates when users drags but that's not relevant to this problem.
More like this