Przeglądaj źródła

fix sprite and animated sprite.

SakiKawasaki 4 lat temu
rodzic
commit
f3b2d42a0c

+ 1 - 1
src/nodesnim/nodes2d/animated_sprite.nim

@@ -51,7 +51,7 @@ method draw*(self: AnimatedSpriteRef, w, h: GLfloat) =
     frames_count = self.animations[self.animation].frames.len()
   if frame >= 0 and frame < frames_count:
     var texture = self.animations[self.animation].frames[frame]
-    if texture.texture > 0:
+    if texture.texture > 0'u32:
       self.rect_size = texture.size
 
   # Recalculate position.

+ 1 - 1
src/nodesnim/nodes2d/sprite.nim

@@ -40,7 +40,7 @@ proc Sprite*(name: string = "Sprite"): SpriteRef =
 method draw*(self: SpriteRef, w, h: GLfloat) =
   ## this method uses in the `window.nim`.
   {.warning[LockLevel]: off.}
-  if self.texture.texture > 0:
+  if self.texture.texture > 0'u32:
     self.rect_size = self.texture.size
 
   # Recalculate position.