@@ -225,22 +225,23 @@ void translateShellBoundsToSecondMonitor() {
225225 Rectangle boundsInPixelsForRightMonitor = new Rectangle (3840 , 0 , 2560 , 1440 );
226226 monitors = new Monitor [] { createMonitor (mapper , boundsInPixelsForLeftMonitor , 150 ),
227227 createMonitor (mapper , boundsInPixelsForRightMonitor , 150 ) };
228- Display display = new Display () {
229- @ Override
230- public Monitor [] getMonitors () {
231- return monitors ;
232- }
233-
234- @ Override
235- public Monitor getPrimaryMonitor () {
236- return monitors [0 ];
237- }
238- };
239- Shell shell = new Shell (display );
240- shell .setBounds (3839 , 0 , 100 , 100 );
228+ Rectangle currentPosition = new Rectangle .WithMonitor (3839 , 0 , 100 , 100 , monitors [1 ]);
229+ Rectangle result = mapper .translateFromDisplayCoordinates (currentPosition );
230+ assertTrue (monitors [1 ].getClientArea ().intersects (result ));
231+ }
241232
242- Rectangle p2 = mapper .translateFromDisplayCoordinates (shell .getBounds ());
243- assertTrue (monitors [1 ].getClientArea ().intersects (p2 ));
233+ @ Test
234+ void translateShellPointsToSecondMonitor () {
235+ MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper ();
236+ Rectangle boundsInPixelsForLeftMonitor = new Rectangle (0 , 0 , 2560 , 1440 );
237+ Rectangle boundsInPixelsForRightMonitor = new Rectangle (3840 , 0 , 2560 , 1440 );
238+ monitors = new Monitor [] { createMonitor (mapper , boundsInPixelsForLeftMonitor , 150 ),
239+ createMonitor (mapper , boundsInPixelsForRightMonitor , 150 ) };
240+ Point currentPosition = new Point .WithMonitor (3839 , 0 , monitors [1 ]);
241+ Point size = new Point (100 , 100 );
242+ Point result = mapper .translateFromDisplayCoordinates (currentPosition );
243+ Rectangle resultRect = new Rectangle (result .x , result .y , size .x , size .y );
244+ assertTrue (monitors [1 ].getClientArea ().intersects (resultRect ));
244245 }
245246
246247 private Point createExpectedPoint (CoordinateSystemMapper mapper , int x , int y , Monitor monitor ) {
0 commit comments