Problem With Load Bar

My game generates a random island, and I have a loading bar that shows while it’s generating. I’m pretty sure I’m using the right formula (CurrentValue/MaxValue*BarLength), but my load bar still gets too long for the outer box. I think that’s because every island is different so I have to do something different with the BarLength area, but I’m not sure what I’d do to it. What I’m doing currently is taking the number of sand tiles placed, dividing it by the area of the island (a number gotten by multiplying variables for island width and height), and multiplying by 240, the length that my bar should be at at 100%. The bar goes past the boundary by a different amount for each island. What do I do?

Do you adjust the width of the outer box too?