diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index 53883f3..e5a5e54 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -159,10 +159,13 @@ (.draw object batch 1)) (defmethod draw-entity! :texture - [^SpriteBatch batch {:keys [^TextureRegion object x y width height] - :or {x 0 y 0 width 0 height 0}}] + [^SpriteBatch batch {:keys [^TextureRegion object x y width height]}] (assert object) - (.draw batch object (float x) (float y) (float width) (float height))) + (let [x (float (or x 0)) + y (float (or y 0)) + width (float (or width (.getRegionWidth object))) + height (float (or height (.getRegionHeight object)))] + (.draw batch object x y width height))) (defn draw! [{:keys [renderer] :as screen} entities] (assert renderer)