Skip to content

Commit b27c2aa

Browse files
committed
Assume .png if no image extention.
1 parent 0c5390e commit b27c2aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/fidget/opengl/context.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,9 @@ proc getOrLoadImageRect(ctx: Context, imagePath: string | Hash): Rect =
416416
if imagePath is Hash:
417417
return ctx.entries[imagePath]
418418

419-
let filePath = cast[string](imagePath) # We know it is a string
419+
var filePath = cast[string](imagePath) # We know it is a string
420+
if splitFile(filePath).ext == "":
421+
filePath.add ".png"
420422
if hash(filePath) notin ctx.entries:
421423
# Need to load imagePath, check to see if the .flippy file is around
422424
echo "[load] ", filePath

0 commit comments

Comments
 (0)