@@ -262,13 +262,13 @@ protected void paintComponent(Graphics g) {
262262
263263 graphics2D .scale (scale .getX (),scale .getY ());
264264
265- float width = graphics2D .getClip ().getBounds ().width / 2 ;
265+ float width = graphics2D .getClip ().getBounds ().width >> 1 ;
266266 float percentW = 1 -scale .getX ();
267- float height = graphics2D .getClip ().getBounds ().height / 2 ;
267+ float height = graphics2D .getClip ().getBounds ().height >> 1 ;
268268 float percentH = 1 -scale .getY ();
269269
270270 graphics2D .translate (width *percentW ,height *percentH );
271- graphics2D .translate (camera .getPosition ().getX (),camera .getPosition ().getY ());
271+ // graphics2D.translate(camera.getPosition().getX(),camera.getPosition().getY());
272272
273273 if (!screen .equals (graphics2D .getClip ().getBounds ())){
274274 screen = new Rectangle (graphics2D .getClip ().getBounds ().x -200 ,graphics2D .getClip ().getBounds ().y -200 ,graphics2D .getClip ().getBounds ().width +500 ,graphics2D .getClip ().getBounds ().height +500 );
@@ -284,11 +284,14 @@ public int compare(Component o1, Component o2){
284284 }
285285 });
286286
287+ g .setColor (Color .WHITE );
288+ g .drawOval ((int ) (Input .getMousePosition ().getX ()-20 ), (int ) (Input .getMousePosition ().getY ()-20 ),50 ,50 );
287289 try {
288290 int lsize = components .size ();
289291 for (int i = 0 ; i < lsize ;i ++){
290292 Component c = renderList .get (i );
291- if (inside (c )) {
293+ if (inside (c ) || true ) {
294+ int layer = c .getLayer ()==0 ?1 :c .getLayer ();
292295 (c ).render (graphics2D );
293296 //if(!c.isVisible()){
294297 // c.setVisible(true);
@@ -308,7 +311,7 @@ public int compare(Component o1, Component o2){
308311 LightManager .render (graphics2D );
309312 graphics2D .translate (camera .getPosition ().getX (),camera .getPosition ().getY ());
310313 }
311-
314+ //graphics2D.dispose();
312315 }catch (Exception e ){}
313316 }
314317}
0 commit comments