summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/defs.h1
-rw-r--r--src/ui/documentwidget.c10
2 files changed, 10 insertions, 1 deletions
diff --git a/src/defs.h b/src/defs.h
index c309950d..80951997 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -69,3 +69,4 @@ enum iFileVersion {
69#define circle_Icon "\u25cf" 69#define circle_Icon "\u25cf"
70#define circleWhite_Icon "\u25cb" 70#define circleWhite_Icon "\u25cb"
71#define gear_Icon "\u2699" 71#define gear_Icon "\u2699"
72#define explosion_Icon "\U0001f4a5"
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index f3083207..c9878f65 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2844,12 +2844,20 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) {
2844 const iInt2 origin = d->viewPos; 2844 const iInt2 origin = d->viewPos;
2845 if (run->mediaType == image_GmRunMediaType) { 2845 if (run->mediaType == image_GmRunMediaType) {
2846 SDL_Texture *tex = imageTexture_Media(media_GmDocument(d->widget->doc), run->mediaId); 2846 SDL_Texture *tex = imageTexture_Media(media_GmDocument(d->widget->doc), run->mediaId);
2847 const iRect dst = moved_Rect(run->visBounds, origin);
2847 if (tex) { 2848 if (tex) {
2848 const iRect dst = moved_Rect(run->visBounds, origin);
2849 fillRect_Paint(&d->paint, dst, tmBackground_ColorId); /* in case the image has alpha */ 2849 fillRect_Paint(&d->paint, dst, tmBackground_ColorId); /* in case the image has alpha */
2850 SDL_RenderCopy(d->paint.dst->render, tex, NULL, 2850 SDL_RenderCopy(d->paint.dst->render, tex, NULL,
2851 &(SDL_Rect){ dst.pos.x, dst.pos.y, dst.size.x, dst.size.y }); 2851 &(SDL_Rect){ dst.pos.x, dst.pos.y, dst.size.x, dst.size.y });
2852 } 2852 }
2853 else {
2854 drawRect_Paint(&d->paint, dst, tmQuoteIcon_ColorId);
2855 drawCentered_Text(uiLabel_FontId,
2856 dst,
2857 iFalse,
2858 tmQuote_ColorId,
2859 explosion_Icon " Error Loading Image");
2860 }
2853 return; 2861 return;
2854 } 2862 }
2855 else if (run->mediaType) { 2863 else if (run->mediaType) {