From 79b4a29ff7c4e8e516fdd042ced76e8213716676 Mon Sep 17 00:00:00 2001 From: Nic0Nic0Nii Date: Thu, 2 Jun 2022 18:45:50 +0000 Subject: [PATCH] Simplified position calculations Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- src/sig/objects/EditorRenderer.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sig/objects/EditorRenderer.java b/src/sig/objects/EditorRenderer.java index cb11f44..eab8829 100644 --- a/src/sig/objects/EditorRenderer.java +++ b/src/sig/objects/EditorRenderer.java @@ -99,9 +99,11 @@ public class EditorRenderer extends LevelRenderer{ @Override protected void drawMapTileForEditorMode(int x, int y) { if (x==RabiClone.p.highlightedSquare.getX()&&y==RabiClone.p.highlightedSquare.getY()) { - DrawTransparentTile(x*Tile.TILE_WIDTH-this.getX(),y*Tile.TILE_HEIGHT-this.getY(),selectedTile,Alpha.ALPHA160); - Draw_Text(x*Tile.TILE_WIDTH-this.getX()+2,y*Tile.TILE_HEIGHT-this.getY()-Font.PROFONT_12.getGlyphHeight()-2,new StringBuilder(selectedTile.toString()),Font.PROFONT_12); - Draw_Text_Ext(x*Tile.TILE_WIDTH-this.getX()+2,y*Tile.TILE_HEIGHT-this.getY()+Tile.TILE_HEIGHT+2,new StringBuilder(selectedTile.toString()),Font.PROFONT_12,Alpha.ALPHA0,PaletteColor.CRIMSON); + double tileX = x*Tile.TILE_WIDTH-this.getX(); + double tileY = y*Tile.TILE_HEIGHT-this.getY(); + DrawTransparentTile(tileX,tileY,selectedTile,Alpha.ALPHA160); + Draw_Text(tileX+2,tileY-Font.PROFONT_12.getGlyphHeight()-2,new StringBuilder(selectedTile.toString()),Font.PROFONT_12); + Draw_Text_Ext(tileX+2,tileY+Tile.TILE_HEIGHT+2,new StringBuilder(selectedTile.toString()),Font.PROFONT_12,Alpha.ALPHA0,PaletteColor.CRIMSON); } } }