-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Introduced in #23, but due to pixel-based calculation of window height and width instead of percent, the "automatic repositioning" which ensured fish and target coordinates were always within the visible window needs to be redone manually.
Example: a fish has targetX of 1000px, but the window is suddenly resized to 300px tall. The fish will happily move 700px offscreen and reach that position and will only respond to the resize when a new targetX/Y is calculated - the new values will respond to the new screen size so it'll "swim" back onscreen to a new targetX value which will be less than 300.
the most plausible solution I can think of would be another listener for another function that, on resize, checks all x/y values - both position and target - and then if needed forces them to be within the new window height/width boundaries. Instead of sitting in App, it will probably need to be called in each Dopefish so it has access to the proper this namespace.