キャンバスに一連の長方形を描いています。長方形はある角度で動くはずです。何らかの理由で、移動するとスケールアップします。
xPos += xSpeed;
yPos += ySpeed;
updateBounds(xPos, yPos, width, height);
私の UpdateBounds メソッド:
public void updateBounds(double x, double y, double w, double h) {
bounds.setRect(x, y, w, h);
}
Bounds は Rectangle2D オブジェクトです。そして私の描画方法:
g.fillRect((int) bounds.getX(), (int) bounds.getY(),
(int) bounds.getMaxX(), (int) bounds.getMaxY());
なぜこのような動作をするのですか?