diff --git a/DoubleDeckerBus/src/main/java/com/example/doubledeckerbus/DrawingBus.java b/DoubleDeckerBus/src/main/java/com/example/doubledeckerbus/DrawingBus.java index 29f30a7..d81f6d0 100644 --- a/DoubleDeckerBus/src/main/java/com/example/doubledeckerbus/DrawingBus.java +++ b/DoubleDeckerBus/src/main/java/com/example/doubledeckerbus/DrawingBus.java @@ -28,6 +28,8 @@ public class DrawingBus { } public void SetPosition(int x, int y, int width, int height) { + if (x < 0 || y < 0) return; + if (_pictureWidth <= _busWidth || _pictureHeight <= _busHeight) { _pictureWidth = _null; _pictureHeight = _null;