]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix placeholder image not visible when a screenshot (in general an image with .forced...
authorterencehill <piuntn@gmail.com>
Sun, 20 Oct 2013 10:55:26 +0000 (12:55 +0200)
committerSamual Lenks <samual@xonotic.org>
Sun, 26 Jan 2014 04:35:11 +0000 (23:35 -0500)
(cherry picked from commit 6605e0e9a21f2848846fa0f4b4b26eb75d9d2ce2)

qcsrc/menu/item/image.c

index 8ae17dbcc1a2558a6250489e2bb2e7be378a4a77..1d5471e15c09d1ea2bb45980648f8477253e5d90 100644 (file)
@@ -70,6 +70,12 @@ void Image_updateAspect(entity me)
                if(me.forcedAspect < 0)
                {
                        sz = draw_PictureSize(me.src);
+                       if(sz_x <= 0 || sz_y <= 0)
+                       {
+                               // image is broken or doesn't exist, set the size for the placeholder image
+                               sz_x = me.size_x;
+                               sz_y = me.size_y;
+                       }
                        asp = sz_x / sz_y;
                }
                else