make sure new sector include target sector (#244)

if shiftx, shifty calc from total width,height, the result sector did not include the target sector
This commit is contained in:
LQ
2018-10-15 22:17:52 +08:00
committed by Anuken
parent b6beacf053
commit 21bc195213

View File

@@ -370,7 +370,7 @@ public class Sectors{
for(int x = 1; x <= width; x++){
for(int y = 1; y <= height; y++){
for(GridPoint2 point : Geometry.d8edge){
int shiftx = (int)(-width/2f + (point.x * (width - 1))/2f), shifty = (int)(-height/2f + (point.y * (height - 1))/2f);
int shiftx = (int)(-x/2f + (point.x * (x - 1))/2f), shifty = (int)(-y/2f + (point.y * (y - 1))/2f);
if(canFit(sector.x + shiftx, sector.y + shifty, x, y)){
finalWidth = x;
finalHeight = y;