@@ -64,27 +64,27 @@ private SingleZoomCoordinateSystemMapper getSingleZoomCoordinateSystemMapper() {
6464 void translatePointInNoMonitorBackAndForthShouldBeTheSame (CoordinateSystemMapper mapper ) {
6565 setupMonitors (mapper );
6666 Point pt = createExpectedPoint (mapper , 5000 , -400 , monitors [0 ]);
67- Point px = mapper .translateToDisplayCoordinates (pt , monitors [ 0 ]. getZoom () );
68- assertEquals (pt , mapper .translateFromDisplayCoordinates (px , monitors [ 0 ]. getZoom () ));
67+ Point px = mapper .translateToDisplayCoordinates (pt );
68+ assertEquals (pt , mapper .translateFromDisplayCoordinates (px ));
6969 }
7070
7171 @ Test
7272 void translatePointInGapBackAndForthInSingleZoomShouldBeTheSame () {
7373 SingleZoomCoordinateSystemMapper mapper = getSingleZoomCoordinateSystemMapper ();
7474 setupMonitors (mapper );
7575 Point pt = new Point (1900 , 400 );
76- Point px = mapper .translateToDisplayCoordinates (pt , monitors [ 0 ]. getZoom () );
77- assertEquals (pt , mapper .translateFromDisplayCoordinates (px , monitors [ 0 ]. getZoom () ));
76+ Point px = mapper .translateToDisplayCoordinates (pt );
77+ assertEquals (pt , mapper .translateFromDisplayCoordinates (px ));
7878 }
7979
8080 @ Test
8181 void translatePointInGapBackAndForthInMultiZoomShouldEndInsideTheSameMonitor () {
8282 MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper ();
8383 setupMonitors (mapper );
8484 Point pt = new Point (1900 , 400 );
85- Point px = mapper .translateToDisplayCoordinates (pt , monitors [ 0 ]. getZoom () );
86- Point translatedPt = mapper .translateFromDisplayCoordinates (px , monitors [ 0 ]. getZoom () );
87- Point translatedPx = mapper .translateToDisplayCoordinates (translatedPt , monitors [ 0 ]. getZoom () );
85+ Point px = mapper .translateToDisplayCoordinates (pt );
86+ Point translatedPt = mapper .translateFromDisplayCoordinates (px );
87+ Point translatedPx = mapper .translateToDisplayCoordinates (translatedPt );
8888 assertEquals (new Point (translatedPt .x , translatedPt .y ), translatedPx );
8989 assertEquals (translatedPx , px );
9090 }
@@ -94,26 +94,26 @@ void translatePointInGapBackAndForthInMultiZoomShouldEndInsideTheSameMonitor() {
9494 void translateRectangleInNoMonitorBackAndForthShouldBeTheSame (CoordinateSystemMapper mapper ) {
9595 setupMonitors (mapper );
9696 Rectangle rectInPts = createExpectedRectangle (mapper , 5000 , -400 , 200 , 200 , monitors [0 ]);
97- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () );
98- assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () ));
97+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
98+ assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs ));
9999 }
100100
101101 @ Test
102102 void translateRectangleInGapBackAndForthInSingleZoomShouldBeTheSame () {
103103 SingleZoomCoordinateSystemMapper mapper = getSingleZoomCoordinateSystemMapper ();
104104 setupMonitors (mapper );
105105 Rectangle rectInPts = new Rectangle (1800 , 400 , 100 , 100 );
106- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () );
107- assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () ));
106+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
107+ assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs ));
108108 }
109109
110110 @ Test
111111 void translateRectangleInGapBackAndForthInMultiZoomShouldBeInMonitorBounds () {
112112 MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper ();
113113 setupMonitors (mapper );
114114 Rectangle rectInPts = new Rectangle (1800 , 400 , 100 , 100 );
115- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () );
116- Rectangle rectInPtsTranslated = mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () );
115+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
116+ Rectangle rectInPtsTranslated = mapper .translateFromDisplayCoordinates (rectInPxs );
117117 boolean isInsideMonitor = false ;
118118 for (Monitor monitor : monitors ) {
119119 if (monitor .getClientArea ().intersects (rectInPtsTranslated )) {
@@ -129,46 +129,45 @@ void translateRectangleInGapPartiallyInRightBackAndForthInSingleZoomShouldBeTheS
129129 SingleZoomCoordinateSystemMapper mapper = getSingleZoomCoordinateSystemMapper ();
130130 setupMonitors (mapper );
131131 Rectangle rectInPts = new Rectangle (1950 , 400 , 150 , 100 );
132- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () );
133- assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () ));
132+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
133+ assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs ));
134134 }
135135
136136 @ Test
137137 void translateRectangleInGapPartiallyInRightBackAndForthInMultiZoomShouldBeInside () {
138138 MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper ();
139139 setupMonitors (mapper );
140140 Rectangle rectInPts = new Rectangle .WithMonitor (1950 , 400 , 150 , 100 , monitors [1 ]);
141- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () );
142- assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () ));
141+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
142+ assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs ));
143143 }
144144
145145 @ ParameterizedTest
146146 @ MethodSource ("provideCoordinateSystemMappers" )
147147 void translateRectangleInGapPartiallyInLeftBackAndForthShouldBeTheSame (CoordinateSystemMapper mapper ) {
148148 setupMonitors (mapper );
149149 Rectangle rectInPts = createExpectedRectangle (mapper , 750 , 400 , 100 , 100 , monitors [0 ]);
150- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () );
151- assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () ));
150+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
151+ assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs ));
152152 }
153153
154154 @ Test
155155 void translateRectangleInPointsInBothMonitorsPartiallyBackAndForthInSingleZoomShouldBeTheSame () {
156156 SingleZoomCoordinateSystemMapper mapper = getSingleZoomCoordinateSystemMapper ();
157157 setupMonitors (mapper );
158158 Rectangle rectInPts = new Rectangle (950 , 400 , 1500 , 100 );
159- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () );
160- assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () ));
159+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
160+ assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs ));
161161 }
162162
163163 @ Test
164164 void translateRectangleInPointsInBothMonitorsPartiallyBackAndForthInMultiZoomShouldNotEndUpInGap () {
165165 MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper ();
166166 setupMonitors (mapper );
167167 Rectangle rectInPts = new Rectangle (950 , 400 , 1500 , 100 );
168- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [0 ].getZoom ());
169- Rectangle rectInPtsTranslated = mapper .translateFromDisplayCoordinates (rectInPxs , monitors [0 ].getZoom ());
170- Rectangle rectInPxsTranslated = mapper .translateToDisplayCoordinates (rectInPtsTranslated ,
171- monitors [0 ].getZoom ());
168+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
169+ Rectangle rectInPtsTranslated = mapper .translateFromDisplayCoordinates (rectInPxs );
170+ Rectangle rectInPxsTranslated = mapper .translateToDisplayCoordinates (rectInPtsTranslated );
172171 assertEquals (rectInPxs , rectInPxsTranslated );
173172 }
174173
@@ -182,13 +181,13 @@ void moveRectangleInPixelsInRightMonitorsPartiallyBackAndForthShouldBeTheSame()
182181 expectedSmallRectInPxs .y = rectInPxs .y + (rectInPxs .height / 2 ) - 200 ;
183182 expectedSmallRectInPxs .width = 400 ;
184183 expectedSmallRectInPxs .height = 400 ;
185- Rectangle rectInPts = mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () );
184+ Rectangle rectInPts = mapper .translateFromDisplayCoordinates (rectInPxs );
186185 Rectangle smallRectInPts = new Rectangle (0 , 0 , 0 , monitors [0 ].getZoom ());
187186 smallRectInPts .x = rectInPts .x + (rectInPts .width / 2 ) - 200 ;
188187 smallRectInPts .y = rectInPts .y + (rectInPts .height / 2 ) - 200 ;
189188 smallRectInPts .width = 400 ;
190189 smallRectInPts .height = 400 ;
191- Rectangle smallRectInPxs = mapper .translateToDisplayCoordinates (smallRectInPts , monitors [ 0 ]. getZoom () );
190+ Rectangle smallRectInPxs = mapper .translateToDisplayCoordinates (smallRectInPts );
192191 assertEquals (expectedSmallRectInPxs , smallRectInPxs );
193192 }
194193
@@ -197,26 +196,26 @@ void moveRectangleInPixelsInRightMonitorsPartiallyBackAndForthShouldBeTheSame()
197196 void translateRectangleInPixelsOutisdeMonitorsBackAndForthShouldBeTheSame (CoordinateSystemMapper mapper ) {
198197 setupMonitors (mapper );
199198 Rectangle rectInPxs = new Rectangle (400 , 2400 , 1000 , 1000 );
200- Rectangle rectInPts = mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () );
201- assertEquals (rectInPxs , mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () ));
199+ Rectangle rectInPts = mapper .translateFromDisplayCoordinates (rectInPxs );
200+ assertEquals (rectInPxs , mapper .translateToDisplayCoordinates (rectInPts ));
202201 }
203202
204203 @ ParameterizedTest
205204 @ MethodSource ("provideCoordinateSystemMappers" )
206205 void translateRectangleInPixelsInBothMonitorsBackAndForthShouldBeTheSame (CoordinateSystemMapper mapper ) {
207206 setupMonitors (mapper );
208207 Rectangle rectInPxs = new Rectangle (1500 , 400 , 502 , 500 );
209- Rectangle rectInPts = mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () );
210- assertEquals (rectInPxs , mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () ));
208+ Rectangle rectInPts = mapper .translateFromDisplayCoordinates (rectInPxs );
209+ assertEquals (rectInPxs , mapper .translateToDisplayCoordinates (rectInPts ));
211210 }
212211
213212 @ ParameterizedTest
214213 @ MethodSource ("provideCoordinateSystemMappers" )
215214 void translateRectangleInPixelsForZeroSize (CoordinateSystemMapper mapper ) {
216215 setupMonitors (mapper );
217216 Rectangle rectInPts = createExpectedRectangle (mapper , 0 , 0 , 0 , 0 , monitors [0 ]);
218- Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts , monitors [ 0 ]. getZoom () );
219- assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs , monitors [ 0 ]. getZoom () ));
217+ Rectangle rectInPxs = mapper .translateToDisplayCoordinates (rectInPts );
218+ assertEquals (rectInPts , mapper .translateFromDisplayCoordinates (rectInPxs ));
220219 }
221220
222221 private Point createExpectedPoint (CoordinateSystemMapper mapper , int x , int y , Monitor monitor ) {
0 commit comments