Merge pull request #305 from UniquePassive/overlay-improvements
Fix BackgroundComponent's background overflow
This commit is contained in:
@@ -80,16 +80,20 @@ public class BackgroundComponent implements RenderableEntity
|
|||||||
graphics.fill(rectangle);
|
graphics.fill(rectangle);
|
||||||
|
|
||||||
// Render outside stroke
|
// Render outside stroke
|
||||||
final Rectangle outsideStroke = new Rectangle(rectangle);
|
final Rectangle outsideStroke = new Rectangle();
|
||||||
outsideStroke.grow(-BORDER_OFFSET / 2,- BORDER_OFFSET / 2);
|
outsideStroke.setLocation(rectangle.x, rectangle.y);
|
||||||
|
outsideStroke.setSize(rectangle.width - BORDER_OFFSET / 2, rectangle.height - BORDER_OFFSET / 2);
|
||||||
graphics.setColor(outsideStrokeColor);
|
graphics.setColor(outsideStrokeColor);
|
||||||
graphics.draw(outsideStroke);
|
graphics.draw(outsideStroke);
|
||||||
|
|
||||||
// Render inside stroke
|
// Render inside stroke
|
||||||
final Rectangle insideStroke = new Rectangle(rectangle);
|
final Rectangle insideStroke = new Rectangle();
|
||||||
insideStroke.grow(-BORDER_OFFSET, -BORDER_OFFSET);
|
insideStroke.setLocation(rectangle.x + BORDER_OFFSET / 2, rectangle.y + BORDER_OFFSET / 2);
|
||||||
|
insideStroke.setSize(rectangle.width - BORDER_OFFSET - BORDER_OFFSET / 2,
|
||||||
|
rectangle.height - BORDER_OFFSET - BORDER_OFFSET / 2);
|
||||||
graphics.setColor(insideStrokeColor);
|
graphics.setColor(insideStrokeColor);
|
||||||
graphics.draw(insideStroke);
|
graphics.draw(insideStroke);
|
||||||
|
|
||||||
return new Dimension(rectangle.getSize());
|
return new Dimension(rectangle.getSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user