# HG changeset patch
# User sam <sam@basx.dev>
# Date 1724515399 -25200
# Node ID f65f252331274f5cf6c51bf8447cc9126c0afb5f
# Parent  deefc3573b6eb56254d12928f6099ab0c911e606
fix: transparent tiles are loaded

diff -r deefc3573b6e -r f65f25233127 semicongine/image.nim
--- a/semicongine/image.nim	Sat Aug 24 22:30:08 2024 +0700
+++ b/semicongine/image.nim	Sat Aug 24 23:03:19 2024 +0700
@@ -146,9 +146,9 @@
     tilesY = height div tilesize
   result = ImageArray[T](width: tilesize, height: tilesize)
   var tile = newSeq[T](tilesize * tilesize)
-  var hasNonTransparent = when T is BGRA: false else: true
   for ty in 0 ..< tilesY:
     for tx in 0 ..< tilesY:
+      var hasNonTransparent = when T is BGRA: false else: true
       let baseI = ty * tilesize * width + tx * tilesize
       for y in 0 ..< tilesize:
         for x in 0 ..< tilesize: