render: texture: Fix bug in texture region coordinate calculation.
authorDavid Thompson <dthompson2@worcester.edu>
Wed, 18 Oct 2017 03:05:58 +0000 (23:05 -0400)
committerDavid Thompson <dthompson2@worcester.edu>
Wed, 18 Oct 2017 03:05:58 +0000 (23:05 -0400)
* chickadee/render/texture.scm (make-texture-region): Fix broken
  texcoord width/height calculation.

chickadee/render/texture.scm

index 0c4480b..34be3fe 100644 (file)
@@ -248,7 +248,7 @@ measured in pixels and must be integers."
   (let* ((tw (texture-width texture))
          (th (texture-height texture))
          (gl-rect (make-rect (/ x tw) (/ y th)
-                             (/ (+ x width) tw) (/ (+ y height) th))))
+                             (/ width tw) (/ height th))))
     (%make-texture-region texture x y width height gl-rect
                           (f32vector width height))))